HOW TO MERGE TWO MACROS

K

K

Hi all , I have macro (see below) from which I am taking sort of work
of progress bar and it works fine

Macro 1 ================================================>

Public RunWhen As Double

Sub StartBlink()

If Range("N4").Value = "UPDATING PLEASE WAIT." Then
Range("N4").Value = "UPDATING PLEASE WAIT. ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. ." Then
Range("N4").Value = "UPDATING PLEASE WAIT. . ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. . ." Then
Range("N4").Value = "UPDATING PLEASE WAIT. . . ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. . . ." Then
Range("N4").Value = "UPDATING PLEASE WAIT. . . . ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. . . . ." Then
Range("N4").Value = "UPDATING PLEASE WAIT. . . . . ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. . . . . ." Then
Range("N4").Value = "UPDATING PLEASE WAIT. . . . . . ."
ElseIf Range("N4").Value = "UPDATING PLEASE WAIT. . . . . . ."
Then
Range("N4").Value = "UPDATING PLEASE WAIT. . . . . . . ."
Else
Range("N4").Value = "UPDATING PLEASE WAIT."
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub

Sub StopBlink()
Range("N4").Value = "UPDTAED"
Application.OnTime RunWhen, "StartBlink", , False
End Sub

<========================================================


I have another macro (see below) which basically put formulas and copy
them down

Macro 2 ===================================================>

Sub PUTFORMULAS()
Dim Allc As Long
Range("G6").Select
ActiveCell.FormulaR1C1 = "=RC[-6]&RC[-5]&RC[-4]"
Range("H6").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-2]>0,RC[-2],IF(AND(RC[-2]="""",RC[-3]=""""),"""",RIGHT(RC[-3],
2)))"
Range("I6").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]="""","""",
(RIGHT(RC[-1],LEN(RC[-1]))*1))"
Range("J6").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]="""","""",RC[-6])"
Range("K6").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]=R[1]C[-4],"""",RC[-4])"
Range("L6").Select
ActiveCell.FormulaR1C1 = _

"=IF(RC[-1]="""","""",IF(SUMIF(R6C7:R10000C7,RC[-1],R6C10:R10000C10)=0,""ZERO
BUDGET"",SUMIF(R6C7:R10000C7,RC[-1],R6C10:R10000C10)))"
Allc = Cells(Rows.Count, "A").End(xlUp).Row
Range("G6:L6").Copy Range("G6").Offset(0, 0).Range("A1:A" & Allc -
5)
Application.CutCopyMode = False

End Sub

<============================================================

I got button on Sheet which got this Macro assigned (see below)

Macro 3 ======================================================>

Sub UPDATE
Call StartBlink
Call PUTFORMULAS
Call StopBlink

End Sub

<=============================================================

I know that I cant run tow or more than two macros at the same time
which I am tring to do as you can see above. I want some friend to
tell me that what should I do to achive my goal. I want that when I
click the button then Macro "PUTFORMULAS" should start but same time i
want to see Macro "StartBlink" as well and once Macro "PUTFORMULAS"
will finish i want Macro "StopBlink" to work. Can any body know how
can i merge Macro "StartBlink" and "PUTFORMULAS".
 

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

PLEASE CAN ANBODY HELP 2
PROGRESS BAR QUESTION 1
Checkbox linked to calcs 0
Checkbox linked to calcs 1
how to use Solver in Excel VBA 1
Data samples 3
Geometric progression in VBA 10
Macro 3

Top