Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Columns letter of selection
Hi all,
if I select cells B2 to D2, and I run this VBA code : MsgBox Selection.Address(False, False) it gives me B2:D2. I'd like to get the columns only, like B:D So I tried : MsgBox Columns(Selection.Column).Address(False, False) but it gives me B:B Is there an easy way to solve this without playing with left, right, mid or instr ? Thanks for any insight, Nicomus |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Columns letter of selection
Hi Nicodemus,
Try: Selection.EntireColumn.Address(0, 0) --- Regards, Norman "Nicodemus" wrote in message ... Hi all, if I select cells B2 to D2, and I run this VBA code : MsgBox Selection.Address(False, False) it gives me B2:D2. I'd like to get the columns only, like B:D So I tried : MsgBox Columns(Selection.Column).Address(False, False) but it gives me B:B Is there an easy way to solve this without playing with left, right, mid or instr ? Thanks for any insight, Nicomus |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Columns letter of selection
Hi Norman,
great ! It works perfectly the way I wanted it !! Thank you for your (very) fast and efficient answer. Nicodemus "Norman Jones" wrote: Hi Nicodemus, Try: Selection.EntireColumn.Address(0, 0) --- Regards, Norman "Nicodemus" wrote in message ... Hi all, if I select cells B2 to D2, and I run this VBA code : MsgBox Selection.Address(False, False) it gives me B2:D2. I'd like to get the columns only, like B:D So I tried : MsgBox Columns(Selection.Column).Address(False, False) but it gives me B:B Is there an easy way to solve this without playing with left, right, mid or instr ? Thanks for any insight, Nicomus |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
separate columns (three letter code) | Excel Discussion (Misc queries) | |||
ADD 2 COLUMNS USING 1 LETTER AND 1 NUMBER | Excel Worksheet Functions | |||
How to count letter B based on data in other columns | Excel Worksheet Functions | |||
CHAR funtcion with double letter columns | Excel Worksheet Functions | |||
How do I get the columns in Excel to go back to letter sequence | Excel Discussion (Misc queries) |