Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Code Consolidation (1)

Is there a way to consolidate these subs into one sub? This would be the first of six groups needing condensing
Thanks, Phi

Sub GoToRationale11(
Application.ScreenUpdating = Fals
Sheets("Rationale 1.1").Selec
Application.Goto Reference:=Range("A1"), Scroll:=Tru
ActiveWindow.Zoom = 6
Application.ScreenUpdating = Tru
End Su

Sub GoToRationale12(
Application.ScreenUpdating = Fals
Sheets("Rationale 1.2").Selec
Application.Goto Reference:=Range("A1"), Scroll:=Tru
ActiveWindow.Zoom = 6
Application.ScreenUpdating = Tru
End Su

Sub GoToRationale13(
Application.ScreenUpdating = Fals
Sheets("Rationale 1.3").Selec
Application.Goto Reference:=Range("A1"), Scroll:=Tru
ActiveWindow.Zoom = 6
Application.ScreenUpdating = Tru
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Code Consolidation (1)

Phil

One way:

Sub GoToRationale()
Dim Sh As Worksheet
Application.ScreenUpdating = False

For Each Sh In Sheets(Array("Rationale 1.1", "Rationale 1.2", "Rationale
1.3"))
Sh.Activate
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Next Sh

Application.ScreenUpdating = True
End Sub


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Phil Hageman" skrev i en meddelelse
...
Is there a way to consolidate these subs into one sub? This would be the

first of six groups needing condensing.
Thanks, Phil

Sub GoToRationale11()
Application.ScreenUpdating = False
Sheets("Rationale 1.1").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub

Sub GoToRationale12()
Application.ScreenUpdating = False
Sheets("Rationale 1.2").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub

Sub GoToRationale13()
Application.ScreenUpdating = False
Sheets("Rationale 1.3").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Code Consolidation (1)

One way:

Public Sub GoToRationale11to13()
Dim rOldActiveCell As Range
Dim wsSheet As Worksheet
Set rOldActiveCell = ActiveCell
With Application
.ScreenUpdating = False
For Each wsSheet In Sheets(Array("Rationale 1.1", _
"Rationale 1.2", "Rationale 1.3"))
.Goto wsSheet.Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Next wsSheet
.Goto rOldActiveCell
.ScreenUpdating = True
End With
End Sub



In article ,
Phil Hageman wrote:

Is there a way to consolidate these subs into one sub? This would be the
first of six groups needing condensing.
Thanks, Phil

Sub GoToRationale11()
Application.ScreenUpdating = False
Sheets("Rationale 1.1").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub

Sub GoToRationale12()
Application.ScreenUpdating = False
Sheets("Rationale 1.2").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub

Sub GoToRationale13()
Application.ScreenUpdating = False
Sheets("Rationale 1.3").Select
Application.Goto Reference:=Range("A1"), Scroll:=True
ActiveWindow.Zoom = 69
Application.ScreenUpdating = True
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Code Consolidation (1)

Leo

Thanks for the help

Phil
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Code Consolidation (1)

You're welcome, Phil.

LeoH


"Phil Hageman" skrev i en meddelelse
...
Leo,

Thanks for the help!

Phil



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
Consolidation reno Excel Discussion (Misc queries) 0 October 31st 07 09:07 PM
Consolidation Blue Bunny Excel Discussion (Misc queries) 1 May 8th 07 05:53 PM
consolidation rln3333 Excel Discussion (Misc queries) 2 November 29th 06 11:55 AM
Consolidation capnsean Excel Discussion (Misc queries) 3 July 8th 05 10:53 PM
Consolidation kk Excel Worksheet Functions 8 June 14th 05 01:41 PM


All times are GMT +1. The time now is 12:31 AM.

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"