Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This is the most basic question I'm sure but how can I link numerous sub
statements into one macro? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub MyMacros()
Call macro1 Call macro2 etc End Sub "Call" can be omitted from the above statements except if parameters are passed to the routine. HTH "JOUIOUI" wrote: This is the most basic question I'm sure but how can I link numerous sub statements into one macro? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Like this???
Sub MainProgramNameHere() call Prog1 call Prog2 'do some stuff locally?? call prog3 end sub JOUIOUI wrote: This is the most basic question I'm sure but how can I link numerous sub statements into one macro? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Dave,
Thanks for your help. I was hoping you could help me with this. My Sheet 1 is "All Records", I"m adding 6 new sheets which works great, but then the Add REcords is not working. I'm trying to copy any rows with "4-$" in column A and "GESA CC" in column B from the "All Records" Sheet to the "GESA CC" Sheet. ANy ideas? Sub AllRecordsSortMacros() Call AddSheets Call AddRecords End Sub Sub AddSheets() Dim NewSheets As Variant Dim i As Long NewSheets = Array("Confirm", "GESV CC", "GESA CC", "GESA CK", "All Matches", "All Non Matches") For i = UBound(NewSheets) To LBound(NewSheets) Step -1 Sheets.Add after:=Sheets(1) ActiveSheet.Name = NewSheets(i) Next i End Sub Sub CopyData() Dim rng As Range, cell As Range Dim i As Long, sh As Worksheet With Worksheets("All Matches") Set rng = .Range(.Cells(1, 1), _ .Cells(Rows.Count, 1).End(xlUp)) End With i = 1 Set sh = Worksheets("GESA CC") For Each cell In rng If UCase(Trim(cell.Value)) = "4-$" And _ UCase(Trim(cell.Offset(0, 1).Value)) = "Gesa CC" Then cell.EntireRow.Copy sh.Cells(i, 1) i = i + 1 End If Next End Sub "Dave Peterson" wrote: Like this??? Sub MainProgramNameHere() call Prog1 call Prog2 'do some stuff locally?? call prog3 end sub JOUIOUI wrote: This is the most basic question I'm sure but how can I link numerous sub statements into one macro? -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Without too much looking...
If UCase(Trim(cell.Offset(0, 1).Value)) = "Gesa CC" Then You're comparing something that upper case (you used uCase()) with "Gesa CC". Well, there aren't any uppercase letters that match "esa", so there will never be a match. You could use: If UCase(Trim(cell.Offset(0, 1).Value)) = "GESA CC" Then or if you're really lazy: If UCase(Trim(cell.Offset(0, 1).Value)) = ucase("Gesa CC") Then SITCFanTN wrote: Hi Dave, Thanks for your help. I was hoping you could help me with this. My Sheet 1 is "All Records", I"m adding 6 new sheets which works great, but then the Add REcords is not working. I'm trying to copy any rows with "4-$" in column A and "GESA CC" in column B from the "All Records" Sheet to the "GESA CC" Sheet. ANy ideas? Sub AllRecordsSortMacros() Call AddSheets Call AddRecords End Sub Sub AddSheets() Dim NewSheets As Variant Dim i As Long NewSheets = Array("Confirm", "GESV CC", "GESA CC", "GESA CK", "All Matches", "All Non Matches") For i = UBound(NewSheets) To LBound(NewSheets) Step -1 Sheets.Add after:=Sheets(1) ActiveSheet.Name = NewSheets(i) Next i End Sub Sub CopyData() Dim rng As Range, cell As Range Dim i As Long, sh As Worksheet With Worksheets("All Matches") Set rng = .Range(.Cells(1, 1), _ .Cells(Rows.Count, 1).End(xlUp)) End With i = 1 Set sh = Worksheets("GESA CC") For Each cell In rng If UCase(Trim(cell.Value)) = "4-$" And _ UCase(Trim(cell.Offset(0, 1).Value)) = "Gesa CC" Then cell.EntireRow.Copy sh.Cells(i, 1) i = i + 1 End If Next End Sub "Dave Peterson" wrote: Like this??? Sub MainProgramNameHere() call Prog1 call Prog2 'do some stuff locally?? call prog3 end sub JOUIOUI wrote: This is the most basic question I'm sure but how can I link numerous sub statements into one macro? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is this the proper place to ask my question? | Excel Discussion (Misc queries) | |||
Simple for you, tough for me, basic excel question | Excel Discussion (Misc queries) | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
Basic Template Question | Excel Discussion (Misc queries) | |||
basic pie chart question | Charts and Charting in Excel |