Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Select Various tabs using VBA

On Sat, 30 Sep 2006, Chris wrote:

The following code will need to be performed on each tab except the Data tab:

Range("C5:EK5").Select
Application.CutCopyMode = False
Selection.Copy
Range("C6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("C11:EK11").Select
Application.CutCopyMode = False
Selection.Copy
Range("C12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("C27:EK27").Select
Application.CutCopyMode = False
Selection.Copy
Range("C28").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


When I see glurpy code like this I know it was recorded. I'd simplify it
to:

Range("C5:EK5").Copy
Range("C6").PasteSpecial Paste:=xlPasteValues
Range("C11:EK11").Copy
Range("C12").PasteSpecial Paste:=xlPasteValues
Range("C27:EK27").Copy
Range("C28").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

Much easier to read.

Don <www.donwiss.com (e-mail link at home page bottom).
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
tabs are missing even though 'tools-options-view-sheet tabs' ok? rgranell Excel Worksheet Functions 3 August 16th 08 04:25 PM
Select Various tabs using VBA Chris Excel Programming 1 October 1st 06 06:39 PM
Excel - option to select the same header for mutliple tabs Sarah Beattie Setting up and Configuration of Excel 3 August 31st 06 04:20 PM
Need help with using VBA to select tabs in Excel MFINE Excel Programming 1 July 20th 06 01:56 AM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM


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