Set Next visible cell to a formula [Closed]


I'm using this code to set specific text to visible cells in Column AA. How can I change the below or use a similair method to set the corresponding cells in Column AB to specific formulas . The formula that would correspond to the "Difference" would infact substract the "Pymt Amt" from the "EFT Amt") Any help would be appreciated

Dim row As Long
Dim visibleRow As Long
Dim Labels() As Variant

Labels = Array("Vendor", "EFT", "EFT Amt:", "Pymt Amt:", "Difference:", "Batch ID:")

row = 2
visibleRow = 0
While (((visibleRow - 1) \ LABELS_SPACING) < UBound(Labels))
If (Not ActiveSheet.Rows(row).Hidden) Then
visibleRow = visibleRow + 1

If ((visibleRow - 1) Mod LABELS_SPACING = 0) Then
ActiveSheet.Cells(row, 26) = Labels(visibleRow \ LABELS_SPACING)
End If
End If

row = row + 1

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!