ExcelNooberino
New Member
- Joined
- Jan 2, 2019
- Messages
- 43
- Office Version
- 2016
- Platform
- Windows
Hi guys! Hope y'all having a good summer under the circumstances...
So, I've been trying to create a dashboard to show some KPI of my own sector within the company and I'm stuck with some LastRow coding that I'm not getting out of, so, maybe you can give me a hand here.
Basically I have 3 tables, and for two of them I'm able to get the respective LastRow, but, the other one I just cant because it shares the same columns as the one of the others. For example, the first table goes from F7 to M39; the second table goes from O7 to V20; and the third table stays right below the second one, and it goes from O22 to V28. So the code that I got so far it's good for the first and third tables, like so:
How can I get the LastRow for the second table, is there any way I can declare a specific range and get the last row for that range?!
If I'm not being clear please say so, so I can reformulate the text. Thanks in advance!
So, I've been trying to create a dashboard to show some KPI of my own sector within the company and I'm stuck with some LastRow coding that I'm not getting out of, so, maybe you can give me a hand here.
Basically I have 3 tables, and for two of them I'm able to get the respective LastRow, but, the other one I just cant because it shares the same columns as the one of the others. For example, the first table goes from F7 to M39; the second table goes from O7 to V20; and the third table stays right below the second one, and it goes from O22 to V28. So the code that I got so far it's good for the first and third tables, like so:
VBA Code:
Dim wb As Workbook
Dim st As Worksheet
Dim LastRowDay As Long
Dim LastRowMonth As Long
Dim LastRowYear As Long
Set wb = ThisWorkbook
Set st = wb.Sheets("Paragens")
LastRowDay = Cells(st.Rows.Count, "K").End(xlUp).Row
LastRowYear = Cells(st.Rows.Count, "T").End(xlUp).Row
How can I get the LastRow for the second table, is there any way I can declare a specific range and get the last row for that range?!
If I'm not being clear please say so, so I can reformulate the text. Thanks in advance!