ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Names and References (https://www.excelbanter.com/excel-programming/279012-names-references.html)

steve

Names and References
 
Friedrich,

use something like this (modify to match your names)

Dim x as Long

x = Sheets("MySheet").Range("MyRange").Column

Workbook level and sheet level names belong to the workbook and the
sheet.

--
sb
"Friedrich Muecke" wrote in message
...
Hi,

i use automated csv-import for analysis things.
i named all columns in my import sheet (... to be independant of import
changes like additional columns i used 'Sheet1Name & Column1Header' as

name
for column1 in sheet1)

later on i know the name and sheet of some column, but i want to get the
column index.
how to do this with vba?

i tried around with range("..").column, but this doesn't work.
i read about names("...").RefersToRange, but at the end i think i should

ask
the experts ;-)

btw, are these names privat properties or public or ...?

regards, Fritz






Friedrich Muecke

Names and References
 
Hi,

i use automated csv-import for analysis things.
i named all columns in my import sheet (... to be independant of import
changes like additional columns i used 'Sheet1Name & Column1Header' as name
for column1 in sheet1)

later on i know the name and sheet of some column, but i want to get the
column index.
how to do this with vba?

i tried around with range("..").column, but this doesn't work.
i read about names("...").RefersToRange, but at the end i think i should ask
the experts ;-)

btw, are these names privat properties or public or ...?

regards, Fritz




steve

Names and References
 
Friedrich,

You're welcome!

Hope this got you where you wanted to be...

--
sb
"Friedrich Muecke" wrote in message
...
thanks for the hint.

"steve" wrote in message
...
Friedrich,

use something like this (modify to match your names)

Dim x as Long

x = Sheets("MySheet").Range("MyRange").Column

Workbook level and sheet level names belong to the workbook and the
sheet.

--
sb
"Friedrich Muecke" wrote in message
...
Hi,

i use automated csv-import for analysis things.
i named all columns in my import sheet (... to be independant of

import
changes like additional columns i used 'Sheet1Name & Column1Header' as

name
for column1 in sheet1)

later on i know the name and sheet of some column, but i want to get

the
column index.
how to do this with vba?

i tried around with range("..").column, but this doesn't work.
i read about names("...").RefersToRange, but at the end i think i

should
ask
the experts ;-)

btw, are these names privat properties or public or ...?

regards, Fritz










Friedrich Muecke

Names and References
 
thanks for the hint.

"steve" wrote in message
...
Friedrich,

use something like this (modify to match your names)

Dim x as Long

x = Sheets("MySheet").Range("MyRange").Column

Workbook level and sheet level names belong to the workbook and the
sheet.

--
sb
"Friedrich Muecke" wrote in message
...
Hi,

i use automated csv-import for analysis things.
i named all columns in my import sheet (... to be independant of import
changes like additional columns i used 'Sheet1Name & Column1Header' as

name
for column1 in sheet1)

later on i know the name and sheet of some column, but i want to get the
column index.
how to do this with vba?

i tried around with range("..").column, but this doesn't work.
i read about names("...").RefersToRange, but at the end i think i should

ask
the experts ;-)

btw, are these names privat properties or public or ...?

regards, Fritz









All times are GMT +1. The time now is 12:25 PM.

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