Macro help please

R

Ryk

I have two macros I'll put in order below after I explain, can I join
them into one, or can I make another macro that runs the first, then
the second? Each works fine, but second one loops, so combining them
is beyond me, unless there is a way to benchmark loops in code?
Anyways here they are.....
Sheets("Data Entry").Select
Range("B6:B1005").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Test").Select
ActiveWindow.SmallScroll Down:=-84
Range("A3").Select
ActiveSheet.Paste
Range("B3:C1002").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Sheets("Data Entry").Select
ActiveWindow.SmallScroll Down:=-54
ActiveWindow.ScrollRow = 929
ActiveWindow.ScrollRow = 922
ActiveWindow.ScrollRow = 916
ActiveWindow.ScrollRow = 906
ActiveWindow.ScrollRow = 862
ActiveWindow.ScrollRow = 804
ActiveWindow.ScrollRow = 747
ActiveWindow.ScrollRow = 695
ActiveWindow.ScrollRow = 651
ActiveWindow.ScrollRow = 593
ActiveWindow.ScrollRow = 536
ActiveWindow.ScrollRow = 484
ActiveWindow.ScrollRow = 433
ActiveWindow.ScrollRow = 382
ActiveWindow.ScrollRow = 337
ActiveWindow.ScrollRow = 318
ActiveWindow.ScrollRow = 299
ActiveWindow.ScrollRow = 280
ActiveWindow.ScrollRow = 261
ActiveWindow.ScrollRow = 245
ActiveWindow.ScrollRow = 229
ActiveWindow.ScrollRow = 216
ActiveWindow.ScrollRow = 200
ActiveWindow.ScrollRow = 187
ActiveWindow.ScrollRow = 174
ActiveWindow.ScrollRow = 162
ActiveWindow.ScrollRow = 149
ActiveWindow.ScrollRow = 139
ActiveWindow.ScrollRow = 133
ActiveWindow.ScrollRow = 126
ActiveWindow.ScrollRow = 120
ActiveWindow.ScrollRow = 110
ActiveWindow.ScrollRow = 101
ActiveWindow.ScrollRow = 94
ActiveWindow.ScrollRow = 88
ActiveWindow.ScrollRow = 75
ActiveWindow.ScrollRow = 69
ActiveWindow.ScrollRow = 59
ActiveWindow.ScrollRow = 53
ActiveWindow.ScrollRow = 47
ActiveWindow.ScrollRow = 37
ActiveWindow.ScrollRow = 34
ActiveWindow.ScrollRow = 27
ActiveWindow.ScrollRow = 21
ActiveWindow.ScrollRow = 18
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 5
Sheets("Comparison").Select
Range("B6").Select
End Sub


RATECHOOSE Macro
' Macro recorded 9/19/2006 by ryk
'
'
Range("A3").Select
Do While Not IsEmpty(ActiveCell)
Selection.Copy
Sheets("Comparison").Select
Range("A27").Select
ActiveSheet.Paste
Range("A35").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Test").Select
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Comparison").Select
Range("A33").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Test").Select
ActiveCell.Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(1, -2).Select
Loop
End Sub
Thanks for any help!
Dave (AKA Ryk)
 
D

Dave O

Hi, Dave-
If both macros are independent of each other and run properly on their
own, you might create a new macro called "Master" that simply calls
both macros. Both macro names are not shown in your example below, so
let's say the first one is called Macro1. The master program might look
like this:

sub Master()
'calls two other macros
Macro 1
RATECHOOSE
End Sub
 
R

Ryk

Hi Dave O....

I'm Dave L, have had Dave P help me as well hehe.....(these are the
Daves I know I know....)

Anyways jokes aside, I put this in....

Sub Master()
'calls two other macros
MoveNumbersForRPA
RATECHOOSE
End Sub


Get Sub or Function not defined error?

Any ideas?


Dave L
 
D

Dave O

This "Master" macro must be run from within the file that holds the
other macros. Are you doing that? Just checking: I tested this idea
on my version of Excel (2k3) and it worked, so I can't think why it
wouldn't work for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top