Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This does it...
.. Sub SheetCopyValues() Dim s1 As String, s2 As String Dim x As Long, y As Long, i As Long Dim pasteto As String Application.ScreenUpdating = False s1 = "Enter number of first sheet" s2 = "Enter number of last sheet" x = InputBox(s1, "First Sheet to copy to") y = InputBox(s2, "Last Sheet to copy to") For i = x To y Sheets("Master").Cells.Copy On Error Resume Next With Sheets(CStr(i)) .Activate .Range("A1").PasteSpecial Paste:=xlPasteValues .Range("A1") = .Name .Range("B22").Select End With Next i Application.CutCopyMode = False Application.ScreenUpdating = True End Sub -- Cheers Nigel "Paul Black" wrote in message ups.com... Hi Everybody, I would like VBA Code that is Similar to the One Below ( but Not Adapting the One Below, I Still want to Use it as it is ) which Works a Treat ... Code: Sub SheetInsert() Dim s1 As String, s2 As String Dim x As Long, y As Long, i As Long Dim pasteto As String Application.ScreenUpdating = False s1 = "How many sheets would you like to add?" s2 = "What would you like the number of the first sheet to be?" x = InputBox(s1) y = InputBox(s2, "Insert Sheets") For i = 1 To x Sheets.Add After:=Sheets(Sheets.Count) pasteto = i + y - 1 ActiveSheet.Name = pasteto With Sheets(pasteto) Sheets("Master").Cells.Copy _ Destination:=.Range("A1") .Range("A1").Value = .Name .Range("B22").Select End With Next i Application.ScreenUpdating = True End Sub ... to Ask me in the First Box which Sheet to Start with, and the Second Box to Ask me which Sheet to End with ( the Sheets are Numbered 1 to Whatever for Example ). I then want Each of those Sheets to be Highlighted in the Top Left Hand Corner so it Selects ALL of the Sheet, and for ALL of the Sheets Specified. I then want to Copy and Paste Special Using Values. And Finally, I would like the Cursor to End Up in Cell B22 of EVERY Sheet Please. Thanks in Advance. All the Best. Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Values only without Paste Special | Excel Discussion (Misc queries) | |||
Macro to copy and paste special values | Excel Programming | |||
Copy Paste Special Values | Excel Programming | |||
copy paste special values | Excel Programming | |||
Dynamic Copy/Paste Special Formulas/Paste Special Values | Excel Programming |