I am trying to creat an if statement at the beginning of a long set of data. I want it to search the column, and only execute the macro if there is data in each cell, if not, skip column and go to the next column of data.
here's a simple form of a macro for one column, but it will be doing 45 columns of this
Sub B()
Dim iMax As Double, iFMax As Double, iMin As Double, lRowMax As Long
iMax = Application.WorksheetFunction.Max(Range("B2:B20000"))
lRowMax = Range("B2:B20000").Find(iMax).Row
iMin = Application.WorksheetFunction.Min(Range("B2" & ":B" & lRowMax - 1))
Dim rAW As Range
For Each rAW In Range("b2:b20000")
rAW.Offset(, 47) = rAW - iMin
Next
End Sub
Thanks for any help!
here's a simple form of a macro for one column, but it will be doing 45 columns of this
Sub B()
Dim iMax As Double, iFMax As Double, iMin As Double, lRowMax As Long
iMax = Application.WorksheetFunction.Max(Range("B2:B20000"))
lRowMax = Range("B2:B20000").Find(iMax).Row
iMin = Application.WorksheetFunction.Min(Range("B2" & ":B" & lRowMax - 1))
Dim rAW As Range
For Each rAW In Range("b2:b20000")
rAW.Offset(, 47) = rAW - iMin
Next
End Sub
Thanks for any help!