Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I have to determine a range in the following situation:
For example:
- the beginning cell of the range (top on the left) is D2
- suppose lr = 10
- suppose lc = 15
- rng shoud be ("D2:O10")
How can I figure it out?
Thank's.
I have to determine a range in the following situation:
Code:
Dim lr As Long, lc As Long
Dim rng As Range
lr = sheet.Cells(Rows.Count, 1).End(xlUp).Row
lc = sheet.Cells(i, 1).End(xlToRight).Column
If lc >= 16 Then lc = 15
set rng = ?????
For example:
- the beginning cell of the range (top on the left) is D2
- suppose lr = 10
- suppose lc = 15
- rng shoud be ("D2:O10")
How can I figure it out?
Thank's.