VB for excel - easy one
#1
Scooby Regular
Thread Starter
Join Date: Oct 2002
Location: ex UK [SE], now Sunshine State [QLD,AUS]
Posts: 565
Likes: 0
Received 1 Like
on
1 Post
I have a set of macros where...
Macro X calls a set of other macros, say Macro A, then Macro B and then
Macro C
Macro B is a Do / Loop macro, and ends with the command
If z > 20 Then End
Independently Macro B runs nicely, and independently so does Macro C.
However if you call Macro B, then straight away, Macro C, then Macro C
does
not run.
I guess the ending in Macro B is not ideal.
Any ideas on a better way to end, keeping it simple please ??!!
If you want the full code here it is.....
Sub run_all()
Call create_start_time
Call F2_edit_spec
Call create_finish_time
End Sub
Sub create_start_time()
Dim A As Date
'variable A = start clock
A = Now
Range("D2").Select
ActiveCell.Value = A
End Sub
Sub F2_edit_spec()
Range("F1").Select
Do
x = ActiveCell.Value
ActiveCell.Value = x
ActiveCell.Offset(1, 0).Select
z = ActiveCell.Row
If z > 20 Then End
Loop
End Sub
Sub create_finish_time()
Dim B As Date
'variable B = stop clock
B = Now
Range("D3").Select
ActiveCell.Value = B
End Sub
Macro X calls a set of other macros, say Macro A, then Macro B and then
Macro C
Macro B is a Do / Loop macro, and ends with the command
If z > 20 Then End
Independently Macro B runs nicely, and independently so does Macro C.
However if you call Macro B, then straight away, Macro C, then Macro C
does
not run.
I guess the ending in Macro B is not ideal.
Any ideas on a better way to end, keeping it simple please ??!!
If you want the full code here it is.....
Sub run_all()
Call create_start_time
Call F2_edit_spec
Call create_finish_time
End Sub
Sub create_start_time()
Dim A As Date
'variable A = start clock
A = Now
Range("D2").Select
ActiveCell.Value = A
End Sub
Sub F2_edit_spec()
Range("F1").Select
Do
x = ActiveCell.Value
ActiveCell.Value = x
ActiveCell.Offset(1, 0).Select
z = ActiveCell.Row
If z > 20 Then End
Loop
End Sub
Sub create_finish_time()
Dim B As Date
'variable B = stop clock
B = Now
Range("D3").Select
ActiveCell.Value = B
End Sub
#4
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
bluebullet29
General Technical
9
05 October 2015 02:17 PM