VBA Named Range in A1 Offset to left And Name new Range

Shiseiji

Board Regular
Joined
Oct 23, 2009
Messages
214
Office Version
  1. 2019
Platform
  1. Windows
Not as easy as I had hoped. If I'm forced to insert column "A:A" I can, but am hoping to use offset rather than a firm address.
Aa aways, TIA

Ron
Range ws_2Users1_LogOnID is in cell A1.
VBA Code:
    ' Range("ws_2Users1_LogOnID").Offset(, -1).EntireColumn.Insert ' nothing happens 
    Range("ws_2Users1_LogOnID").EntireColumn.Insert 'this works
    Range("wws_2Users1_LogOnID").Offset(, -1).Name = "ws_2Users1_IsClosed"
    Range("ws_2Users1_IsClosed").Value = "Closed Account"
    Range("ws_2Users1_IsClosed").Offset(1, 0).Resize(LastRow).Name = "ws_2Users1_RngIsClosed"
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You cannot offset 1 cell to left if you are already in col A.
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,519
Messages
6,125,297
Members
449,218
Latest member
Excel Master

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