Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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,""ZE* RO 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". |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't believe you can accdomplish that goal in the same instance of Excel.
I have never tried it, but it might be possible to do in separate instances of Excel. However, they would not simultaneously update the same worksheet of a single instance of Excel, so you would still have to merge the data from instance two to instance one of Excel. It could be a complicated process. "K" wrote: 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,""ZEĀ* RO 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". |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this helpful? Dave D-C
Option Explicit Dim BlinkTime As Date Sub Main() Dim TimerZ! Call Blink '-- processing goes here TimerZ = Timer + 30# Do While Timer < TimerZ Cells(1, 1) = Cells(1, 1) + 1 DoEvents Loop '-- end of processing Application.OnTime BlinkTime, "Blink", , False Cells(2, 1) = "UPDATED" End Sub Sub Blink() Static dots$ dots = dots & "." If Len(dots) 8 Then dots = "." Cells(2, 1) = "UPDATING PLEASE WAIT" & dots BlinkTime = Now() + TimeValue("00:00:01") Application.OnTime BlinkTime, "Blink" End Sub K wrote: Hi all , I have macro (see below) from which I am taking sort of work of progress bar and it works fine Sub StartBlink() End Sub Sub StopBlink() End Sub Sub PUTFORMULAS() 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". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|