Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have a column (AO) that I dump a lot of data into and then I name the data "Dept". The data that I dump in the column changes every week so the number of rows changes each week so I need to rename the field. What code can I run to select the data and then name it? Thank you, Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could use a dynamic named range
(http://contextures.com/xlNames01.html#Dynamic) or code something like this: Dim eRow As Long eRow = Cells(Rows.Count, 41).End(xlUp).Row ActiveWorkbook.Names.Add Name:="Dept", _ RefersToR1C1:="=Sheet1!R1C41:R" & eRow & "C41" Regards Rowan Mike R. wrote: Greetings, I have a column (AO) that I dump a lot of data into and then I name the data "Dept". The data that I dump in the column changes every week so the number of rows changes each week so I need to rename the field. What code can I run to select the data and then name it? Thank you, Mike |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike R:
Try ActiveWorkbook.Names.Add Name:="Dept", RefersTo:= _ "=OFFSET(sheet1!$AO$1,,,COUNTA(sheet1!$AO$1:$AO$65 536),1)" MsgBox Range("Dept").Address Range("Dept").Select -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Mike R." wrote: Greetings, I have a column (AO) that I dump a lot of data into and then I name the data "Dept". The data that I dump in the column changes every week so the number of rows changes each week so I need to rename the field. What code can I run to select the data and then name it? Thank you, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding area codes only to phone numbers missing an area code | Excel Discussion (Misc queries) | |||
Client area doesn't display or repaint the extended area from resi | Excel Discussion (Misc queries) | |||
error: "the copy area & the paste area are not the same size & sh | Excel Discussion (Misc queries) | |||
Use values instead of labels on X-axis in Area/Stacked Area Charts | Charts and Charting in Excel | |||
Why I get gray area in sheet tab of page setup? can't resize area. | Excel Discussion (Misc queries) |