Deselet first 3 rows in selection

S

SpeeD

hi.

I have a range selected, but i need to unselect the first 3 rows in that
selection. Note that the selection isnt constant.
How can i do that in VBA

Thanks
SpeeD
 
D

Don Guillett

As ALWAYS, post your code for comments
Sub selectit()
Range("f7").Offset(3).Resize(, 4).Select
End Sub
 
G

Gary''s Student

Sub dural()
t = Selection.Address
s = Split(t, ":")
u = Split(s(0), "$")
u(2) = u(2) + 3
v = Join(u, "$")
w = v & ":" & s(1)
Range(w).Select
End Sub
 
G

Gary Keramidas

give this a try, just make sure the the line after the if line is all on 1 line
in case it wraps when posted.

Sub remove3()
If Selection.Rows.Count > 3 Then
Rows(Selection.Range("A1").Row).Offset(3).Resize(Selection.Rows.Count
- 3).Select
End If
End Sub
 
S

SpeeD

Thank you all for the help!!!
Ill give it a try first thing in the morning (it´s 23:14 where i live).

.... And post the final code in here...

SpeeD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top