Deselect Range

Dannyh1

Well-known Member
Joined
Nov 18, 2009
Messages
1,144
Hi,

I have the following code

Code:
Range(Selection, Selection.Offset(0, 9)).Select

I colour this Range & then I want to go back to the 1st column in Range

I tried below, but this errors

Code:
    Range(Selection, Selection.Offset(0, -9)).Select

Help appreciated.

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
It's better to never use '.Select' or '.Activate' in your code whenever possible. Can you post your whole code please - there may be another way to achieve what you want..
 
Upvote 0
You don't need to select it to change the cell colour.

Rich (BB code):
With Range(Selection, Selection.Offset(0, 9))
    .Interior.ColorIndex = 1
End With

Note, replace the red with your own colour change code.
 
Upvote 0
But if you did want to select, how about

Code:
Selection.Resize(, 1).Select
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top