Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to write a macro that will add a new worksheet to an existin
workbook, rename the new sheet with a name that's in a range of cell (A5:D5 in this case) return to the original worksheet and clear th infomation from selected cells. Everything works, except that the line which renames the ne worksheet has a literal string (pervious cell information) in it. Ho can I make reference to the cell which contains the date instead of th data itself, so tha each time the macro runs it'll name the sheet wit the new data? Or is this even possible? Thanking you Michelle An -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can refer to a cell's value when you name the sheet:
Dim ws As Worksheet Set ws = Worksheets.Add ws.Name = Sheets("Sheet1").Range("C3").Value Michelle Ann < wrote: I'm trying to write a macro that will add a new worksheet to an existing workbook, rename the new sheet with a name that's in a range of cells (A5:D5 in this case) return to the original worksheet and clear the infomation from selected cells. Everything works, except that the line which renames the new worksheet has a literal string (pervious cell information) in it. How can I make reference to the cell which contains the date instead of the data itself, so tha each time the macro runs it'll name the sheet with the new data? Or is this even possible? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert relative cell references to absolute cell references via amacro? | Excel Discussion (Misc queries) | |||
Excel 2003 macros set relative cell references | Excel Discussion (Misc queries) | |||
cell references in macros | Excel Discussion (Misc queries) | |||
Relative (vs. Absolute) Cell References with macros | Excel Discussion (Misc queries) | |||
Relative Cell References in Macros | Excel Programming |