Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default rename worksheet

I want to rename a worksheet using a name in a cell - the problem is then how
to refer to that sheet on the codeeg:

Dim sname As String
sname = Range("A2")
Sheets("QUOTE").Name = sname
Range("B7").Select
ActiveCell.FormulaR1C1 = "=sname!R[-4]C[-2]"

etc.....

it renames the sheet but when it runs the last name it cant find sname - is
the problem my syntax?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default rename worksheet

You need to separate the sname variable from the fixed text

Dim sname As String
sname = Range("A2")
Sheets("QUOTE").Name = sname
Range("B7").FormulaR1C1 = "=" & sname & "!R[-4]C[-2]"


--
HTH

Bob Phillips

"Ciara" wrote in message
...
I want to rename a worksheet using a name in a cell - the problem is then

how
to refer to that sheet on the codeeg:

Dim sname As String
sname = Range("A2")
Sheets("QUOTE").Name = sname
Range("B7").Select
ActiveCell.FormulaR1C1 = "=sname!R[-4]C[-2]"

etc.....

it renames the sheet but when it runs the last name it cant find sname -

is
the problem my syntax?

Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default rename worksheet

Thank you.
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
Can't rename worksheet Brian Preston Excel Discussion (Misc queries) 1 October 15th 06 03:25 AM
Using information from one worksheet, to rename inserted worksheet Lyn Excel Worksheet Functions 0 March 24th 06 12:54 AM
why can't I rename my worksheet? cfc1905 Excel Discussion (Misc queries) 2 February 13th 06 03:19 PM
rename worksheet Anthony Excel Discussion (Misc queries) 4 July 13th 05 01:16 AM
Rename worksheet Donald Duck Excel Programming 3 August 17th 04 10:15 AM


All times are GMT +1. The time now is 03:41 PM.

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

About Us

"It's about Microsoft Excel"