Hi,
I've learned a huge amount the last few weeks, a large part of which has come directly from this community. Thanks, in advance!
I'm struggling somewhat with the object-oriented syntax of VBA. The problem I am trying to solve is finding the last row of data in a large table and uploading the contents of each cell in the row to a database.
Here's the code for selecting the last row with data:
The error message I receive reads:
I feel like it's something simple that I don't quite yet grasp about the way VBA handles Range objects versus simple objects like int/long variables. Any insight would be greatly appreciated!
I've learned a huge amount the last few weeks, a large part of which has come directly from this community. Thanks, in advance!
I'm struggling somewhat with the object-oriented syntax of VBA. The problem I am trying to solve is finding the last row of data in a large table and uploading the contents of each cell in the row to a database.
Here's the code for selecting the last row with data:
Code:
Dim WS As Worksheet
Dim SelRange As Range
Dim LastRowNum As Long
Set WS = Worksheets("Daily Prices")
LastRowNum = WS.Range("A" & Rows.Count).End(xlUp).Row
Set SelRange = WS.Range("A" & LastRowNum, "V" & LastRowNum).Select
The error message I receive reads:
Run-time error '424' Object Required
I feel like it's something simple that I don't quite yet grasp about the way VBA handles Range objects versus simple objects like int/long variables. Any insight would be greatly appreciated!