Hi all -
New to VBA and this forum. Hoping to find a quick answer to what is probably very basic.
I am writing a macro that will loop through spreadsheets with a varying number of columns and rows. One of my needs is to find the minimum and maximum value in the active column based on an index/counter. In this case, the column reference is ColNum.
Column index/loop -
For ColNum = 1 To TotalCols
Find min and max -
FldMin = Application.WorksheetFunction.Min(rng)
FldMax = Application.WorksheetFunction.Max(rng)
What I am struggling with is how to define the range (rng) using ColNum for use in the min and max functions. Have tried several things I have seen online and I'm just not grasping the concept.
Thanks,
Ron
New to VBA and this forum. Hoping to find a quick answer to what is probably very basic.
I am writing a macro that will loop through spreadsheets with a varying number of columns and rows. One of my needs is to find the minimum and maximum value in the active column based on an index/counter. In this case, the column reference is ColNum.
Column index/loop -
For ColNum = 1 To TotalCols
Find min and max -
FldMin = Application.WorksheetFunction.Min(rng)
FldMax = Application.WorksheetFunction.Max(rng)
What I am struggling with is how to define the range (rng) using ColNum for use in the min and max functions. Have tried several things I have seen online and I'm just not grasping the concept.
Thanks,
Ron