Sebastian K.
New Member
- Joined
- Jul 19, 2011
- Messages
- 16
Hi
I'm trying to writ a small code to determin which column has the most filled cells.
I've got the following code:
I've tried adding Worksheets("xxxx") and Sheets("xxxx") in front of the Range but it does'nt seem to help.
Any sugestions?
Best regards
Sebastian
I'm trying to writ a small code to determin which column has the most filled cells.
I've got the following code:
Code:
Dim LastRow As Long
Dim ColCount As Integer
LastRow = 0
For ColCount = 19 To 31 Step 4
If Range(Cells(Rows.Count, ColCount)).End(xlUp).Row > LastRow Then _
LastRow = Range(Cells(Rows.Count, ColCount)).End(xlUp).Row
Next ColCount
I've tried adding Worksheets("xxxx") and Sheets("xxxx") in front of the Range but it does'nt seem to help.
Any sugestions?
Best regards
Sebastian