BigBeachBananas
Active Member
- Joined
- Jul 13, 2021
- Messages
- 450
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi,
I'm trying to set the sourceRange as a dynamic range in VBA that starts from cell AC22 and offset with the height of COUNTA(data_date_range)+1, where data_date_range is a named range.
and width of Columns(InputClaims), where InputClaims is also a named range.
The following formula works in excel:
This doesn't work in VBA and getting "Object doesn't support this property or method" error:
I'm trying to set the sourceRange as a dynamic range in VBA that starts from cell AC22 and offset with the height of COUNTA(data_date_range)+1, where data_date_range is a named range.
and width of Columns(InputClaims), where InputClaims is also a named range.
The following formula works in excel:
Excel Formula:
=OFFSET(AC22,,,COUNTA(data_date_range)+1,COLUMNS(InputClaims))
This doesn't work in VBA and getting "Object doesn't support this property or method" error:
VBA Code:
Dim sourceRange as Range
Set sourceRange = Range("AC22").Resize(Application.WorksheetFunction.CountA(data_date_range) + 1, _
Application.WorksheetFunction.Columns(InputClaims))