Hello. Can someone create a macro for me that does the following: I have a range named "Jim" (cells A2, A4, A6, for a theoretical example), and when I select that range, I would like the macro to expand the selection 1 column to the right. Thanks.
Hello. Can someone create a macro for me that does the following: I have a range named "Jim" (cells A2, A4, A6, for a theoretical example), and when I select that range, I would like the macro to expand the selection 1 column to the right. Thanks.
Maybe:
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Selection.Address = Range("Jim").Address Then Range("Jim").Resize(Range("Jim").Rows.Count, 2).Select End If End Sub
Hi, amratino,
why would you need such kind of macro?
If it´s only an Offset for the Range("Jim"):![]()
Sub Selection_Offset() Dim rngCell As Range Dim rngNew As Range For Each rngCell In Selection If rngNew Is Nothing Then Set rngNew = rngCell.Resize(1, 2) Else Set rngNew = Union(rngNew, rngCell.Resize(1, 2)) End If Next rngCell rngNew.Select Set rngNew = Nothing End Sub
Ciao,![]()
Range("Jim").Offset(0, 1).Select
Holger
Last edited by HaHoBe; 10-04-2013 at 01:02 PM.
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks