ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deselet first 3 rows in selection (https://www.excelbanter.com/excel-programming/423125-deselet-first-3-rows-selection.html)

SpeeD

Deselet first 3 rows in selection
 
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

Don Guillett

Deselet first 3 rows in selection
 
As ALWAYS, post your code for comments
Sub selectit()
Range("f7").Offset(3).Resize(, 4).Select
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SpeeD" wrote in message
...
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



Gary''s Student

Deselet first 3 rows in selection
 
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

--
Gary''s Student - gsnu200829


"SpeeD" wrote:

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


Gary Keramidas[_2_]

Deselet first 3 rows in selection
 
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(S election.Rows.Count
- 3).Select
End If
End Sub


--


Gary K



"SpeeD" wrote in message
...
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



SpeeD

Deselet first 3 rows in selection
 
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


All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com