Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using cell references in Excel Macros

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Using cell references in Excel Macros

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Excel 2003 macros set relative cell references JPI Excel Discussion (Misc queries) 7 May 21st 07 05:08 AM
cell references in macros Dave F Excel Discussion (Misc queries) 3 November 28th 06 05:19 PM
Relative (vs. Absolute) Cell References with macros Claude S. Weiller Excel Discussion (Misc queries) 1 August 3rd 06 08:56 PM
Relative Cell References in Macros Barry Staples Excel Programming 4 January 25th 04 07:44 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"