LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default HOW TO MERGE TWO MACROS

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".
 
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
Mail merge macro: select recipients from Excel during merge Worksmart Excel Programming 0 May 18th 08 06:37 PM
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Mail Merge with Macros GrandMaMa Excel Programming 3 July 10th 07 07:30 AM
mail merge excludes my headers and critical data in Word merge Nix Excel Discussion (Misc queries) 0 April 21st 06 08:35 PM
Merge simple macros to create Complex macro oberon.black Excel Programming 7 September 2nd 05 05:02 PM


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