LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
FGM FGM is offline
external usenet poster
 
Posts: 35
Default Excel Sheets (running from Access)

windows 2000
excel and access 2002
Hi,
Looking for help.
Running Excel from Access.
Have created several Worksheets in an excel spreadsheet Labeling all
starting with R-
I did this from Excel and it put the sheets in R-1, R-2 etc with R-1 on the
far left and R-22 on the far right.
When I do it from Access I get it reversed.
When I did the following macro from excel I got R-1 first and R-22 last on
my combined sheet.
Now from Access I get R-22 first and R-1 last.
Is there a way in the following macro to tell it to start with the first
sheet?
I have tried: with no effect
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Worksheets(1).Activate

Would sure appreciate any help.
Thanks.....

Public Sub Simulation_All()
'To combine all the Simulation Calculation dBA into one Worksheet
Dim strSheetName As String
Dim strRange As String
Dim i As Integer

Sheets.Add Type:="Worksheet"
ActiveSheet.Name = "All-dBA"

Range("A2").Value = "Combine all sheets R-"
Range("A3").Value = "Tab"
Range("B3").Value = "Lvl 10"
Range("C3").Value = "Lvl 50"
Range("D3").Value = "Lvl 90"
Range("E3").Value = "Lvl 99"

'Loop through all Sheets for those starting with "R-"
i = 4
'ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Worksheets(1).Activate
Set FirstBook = Workbooks.Item(1)
' Sheets(1).Select
For Each shtNext In Sheets
strSheetName = shtNext.Name
'for only the sheets starting with R-
If Left(strSheetName, 2) = "R-" Then
Sheets(strSheetName).Activate
Range("K3:K6").Copy
Sheets("All-dBA").Activate
strRange = "B" & i
Range(strRange).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
strRange = "A" & i
Range(strRange).Value = strSheetName
i = i + 1
End If
Next shtNext

End Sub

 
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
Running a Excel function from access vba [email protected] Excel Programming 1 May 9th 06 04:33 PM
Running SQL queries for Access using Excel VBA ibeetb Excel Programming 2 August 31st 05 07:56 AM
Running Access queries from Excel smartchick Excel Programming 4 January 3rd 05 11:23 AM
Getting Access Error Messages when running Access through Excel Dkline[_2_] Excel Programming 0 October 12th 04 09:35 PM
Running Macros in Access from Excel Simon Dowse Excel Programming 1 June 7th 04 03:48 PM


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