LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default sheet name as variable

Hello. In excel macro, I want to make below statements:

1. adding a sheet whose name is a variable( name is taken
from the the cell:sheet1,A1)
2. pasting some rows from another sheet to added sheet.
I made the below code, but it doesn't work

Sub d()
Dim sht As Worksheet

Set sht = Sheets("sheet1").Range("A1").Value

Sheets("sheet2").Rows("10:20").Copy.Sheets(sht).Ra nge("A10")
End Sub

Thanks a lot.

 
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
Add sheet name into a variable. Richhall[_2_] Excel Worksheet Functions 1 September 18th 09 12:11 PM
How To make a sheet reference Variable (eq: sum(sheet!D2:H2)) John Linker Excel Discussion (Misc queries) 3 June 16th 08 11:29 PM
Variable sheet and Formula Sheet Emmett423 Excel Discussion (Misc queries) 2 March 31st 06 02:14 AM
Sheet Name as a Variable? Petitboeuf[_5_] Excel Programming 2 December 21st 05 03:58 PM
variable in a link where the variable is the name of the sheet darrelly Excel Worksheet Functions 1 October 7th 05 08:24 AM


All times are GMT +1. The time now is 08:15 AM.

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"