elliott740
Board Regular
- Joined
- Mar 14, 2008
- Messages
- 52
I am using a FOR/NEXT loop that is copying data from elsewhere to specific cells in a Summary Sheet. I want to draw a border around the data I just put in these columns. When I was testing I used the following:
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeLeft).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeRight).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeTop).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeBottom).Weight = xlMedium
This worked perfectly but how can I remove the hardcoding of E5:J30? The Columns (E-J) are constant and so is the starting row (5) but the 30 is variable (may be 10 rows, may be 50...). I do know what row I stoped loading data.
Please Help,
Tom
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeLeft).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeRight).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeTop).Weight = xlMedium
Worksheets("Sales").Range("E5:J30").Borders(xlEdgeBottom).Weight = xlMedium
This worked perfectly but how can I remove the hardcoding of E5:J30? The Columns (E-J) are constant and so is the starting row (5) but the 30 is variable (may be 10 rows, may be 50...). I do know what row I stoped loading data.
Please Help,
Tom