cursemyhandz
New Member
- Joined
- Apr 4, 2024
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
I have some data in a spreadsheet, and have used VBA to create a dynamic range object from this data like so:
I am new to VBA, so I don't know exactly what this range object is, but I imagine we have coordinates (x_1, y_1) and (x_2, y_2) which define a rectangle. I have a number x_3 (with x_1 < x_3 < x_2), and I want to extract y_1, x_2 and y_2 from my range object to make a new range object with coordinates (x_3, y_1) and (x_2, y_2).
Thank you! Also, I am quite new to VBA, so any resources for getting to grips with this language would be helpful.
VBA Code:
Dim ws As Worksheet
Dim rng As Range
Set ws = ThisWorkbook.Sheets("Sheet1")
Set rng = ws.Range("A1").CurrentRegion
I am new to VBA, so I don't know exactly what this range object is, but I imagine we have coordinates (x_1, y_1) and (x_2, y_2) which define a rectangle. I have a number x_3 (with x_1 < x_3 < x_2), and I want to extract y_1, x_2 and y_2 from my range object to make a new range object with coordinates (x_3, y_1) and (x_2, y_2).
Thank you! Also, I am quite new to VBA, so any resources for getting to grips with this language would be helpful.