Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
vb novice
in my code currently, i am using (1,3) format for cell ref in things like Offset, etc. What i would like to do is have the column not be based on a number, but the header text in row 5. in other word when b8 is active cell then the offset would be (0, and whatever column contains "Invoice #" in header row 5. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
If you have the header "Invoice #" in column D I would use something like: cells(ActiveCell.Row, "D") Hopes this helps. --- Per "KUMPFfrog" skrev i meddelelsen ... vb novice in my code currently, i am using (1,3) format for cell ref in things like Offset, etc. What i would like to do is have the column not be based on a number, but the header text in row 5. in other word when b8 is active cell then the offset would be (0, and whatever column contains "Invoice #" in header row 5. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, but the reason i wanted to ref header text is because it is always
going to be in the column that i want my form to place the user entries, no matter if columns are added or deleted around it. IOW, if i later insert a column in front of say "C" then "Invoice #" is no longer in "D", but "E". "Per Jessen" wrote: Hi If you have the header "Invoice #" in column D I would use something like: cells(ActiveCell.Row, "D") Hopes this helps. --- Per "KUMPFfrog" skrev i meddelelsen ... vb novice in my code currently, i am using (1,3) format for cell ref in things like Offset, etc. What i would like to do is have the column not be based on a number, but the header text in row 5. in other word when b8 is active cell then the offset would be (0, and whatever column contains "Invoice #" in header row 5. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Then we have to look at named ranges.
Select the cell containing the header "Invoice #" and goto Insert Name Define : Name the cell "Invoice" Ok Now you can reference to the cell using Range("Invoice"), so the answer to our provious question will be: iCol = Range("Invoice").Column Cells(ActiveCell.Row, iCol) = "Hello" Hopes this helps --- Per "KUMPFfrog" skrev i meddelelsen ... Thanks, but the reason i wanted to ref header text is because it is always going to be in the column that i want my form to place the user entries, no matter if columns are added or deleted around it. IOW, if i later insert a column in front of say "C" then "Invoice #" is no longer in "D", but "E". "Per Jessen" wrote: Hi If you have the header "Invoice #" in column D I would use something like: cells(ActiveCell.Row, "D") Hopes this helps. --- Per "KUMPFfrog" skrev i meddelelsen ... vb novice in my code currently, i am using (1,3) format for cell ref in things like Offset, etc. What i would like to do is have the column not be based on a number, but the header text in row 5. in other word when b8 is active cell then the offset would be (0, and whatever column contains "Invoice #" in header row 5. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
loop through code and refernce text file for info | Excel Discussion (Misc queries) | |||
Using IF to refernce another cell | Excel Programming | |||
Omit header from first page without embedding header in code | Excel Worksheet Functions | |||
Circular Refernce | Excel Discussion (Misc queries) | |||
Range refernce question... | Excel Programming |