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

Hi all
I am looking for a macro to lookup up a number in cell d5 on worksheet
"ladderprint"

If for example this cell has "11" in it , I want it to copy the whole
worksheet to sheet "ladder 11".

Is this possible?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Copy command

Dim SheetName As String, NewSheet As Worksheet

SheetName = "ladder " & Worksheets("ladderprint").Range("D5").Value
Worksheets("ladderprint").Cells.Copy
On Error GoTo MakeSheet
Set NewSheet = Worksheets(SheetName)
NewSheet.Cells.PasteSpecial xlPasteAll ' or xlPasteValues if you only want
values, etc.
Application.CutCopyMode = False
Exit Sub

MakeSheet:
Set NewSheet = Worksheets.Add()
NewSheet.Name = SheetName
NewSheet.Cells.PasteSpecial xlPasteAll ' or xlPasteValues if you only want
values, etc.
Application.CutCopyMode = False

"browie" wrote:

Hi all
I am looking for a macro to lookup up a number in cell d5 on worksheet
"ladderprint"

If for example this cell has "11" in it , I want it to copy the whole
worksheet to sheet "ladder 11".

Is this possible?

Thanks



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
lock of copy command MANISH Excel Worksheet Functions 2 April 7th 09 06:08 PM
Copy Command will07 Excel Discussion (Misc queries) 1 July 4th 08 06:43 AM
Automate copy command? cwilliams Excel Worksheet Functions 0 April 5th 05 06:51 PM
Automate copy command cwilliams Excel Discussion (Misc queries) 0 April 5th 05 06:47 PM
I want to combine a "match" command with a copy and paste command. alomega Excel Programming 1 February 9th 05 05:52 PM


All times are GMT +1. The time now is 10:29 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"