excel vba can CurrentRegion give a specific selection?

Hi I have the following lines of code

Sub selection()
'Dim ws As Worksheet
Dim rng As Range
'
Set rng = Range("A2").CurrentRegion
'rng.Delete
rng.Select
End Sub

It selects me all the cells that have information in that region, including the row of A1, but I don't want the first row to be selected, is there a way I can indicate to CurrentRegion that it should select all from A2 to all the cells that have information. And no I cannot specify a range because the information that is given in the cells I want to select is variable so it's not always the same length. Any thoughts?

2 Answers

Sub selection() Dim rng As Range Set rng = Range("A1").CurrentRegion rng.Offset(1, 0).Resize(rng.Rows.Count - 1, rng.Columns.Count).Select
End Sub
0

Is it possible to select current region without first column too?

I was trying:

rng.Offset(1, 0).Resize(rng.Rows.Count - 1, rng.Columns.Count - 1).Select

but then, the last col is dropped, not the first one.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like