current macro keeps opening another macro wnen code does not call for it

smakatura

Board Regular
Joined
May 27, 2011
Messages
141
I am running a current macro. when it gets to a specific line, it keeps opening an personal macro that is tied to the sheet. none of my code is calling for it. this is driving me crazy and I don't know why it is doing it.

current macro line that is causing the personal macro to pull up
HTML:
ActiveCell.Value = NewFormula

the full current macro is
HTML:
Sub concatenate_monthly_call_checklist_msg_box()
'
    Dim NumColumns As Integer
    Dim OldFormula As String
    Dim NewFormula As String
    Dim Counter As Integer
    Dim CurrentCell As Range
    
' Select [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=rows]#rows[/URL]  with values from sheet and set as number of columns for loop
    Range("bd1").Select
        '**cell AA2 is set to the max value of a column with a counter in it - each row that has a value adds one to this number via a formula on sheet
    NumColumns = ActiveCell.Value
    
'************* Account number concatenate*****************
  
   
' set initial counter and CurrentCell
    Counter = 2
    
' set initial current cell - used to determine if row is recorded
    Range("bb2").Select
    Set CurrentCell = ActiveCell
    
            
' loop to create formula for cell
    Do While Counter <= NumColumns
        
        If IsEmpty(CurrentCell) = True Then
              NewFormula = OldFormula & vbLf & Counter
              OldFormula = NewFormula
        End If
        
        If IsEmpty(Range("BF1").Value) = False Then
            Range("BF1").Select
            ActiveCell.Value = NewFormula
        End If
        
        CurrentCell.Select
        CurrentCell.Offset(1, 0).Select
        Set CurrentCell = ActiveCell
            
        Counter = Counter + 1
    Loop
     
'pop up message box if needed
    If IsEmpty(Range("bf1")) = False Then
       MsgBox (NewFormula)
    End If
 
End Sub


Any ideas why this line is opening the personal macro that capitalizes the stuff entered into the sheet or how I can turn it off?
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
try turning off calculations - I'm guessing that when you update a formula in a cell, the worksheet change event is firing and the workbook recalculates, and one or more of your cells uses a custom UDF (user defined function) found in your personal workbook.

application.Calculation = xlCalculationManual

your code

application.Calculation = xlCalculationAutomatic
 
Upvote 0
try
Sub concatenate_monthly_call_checklist_msg_box()
'

Application.EnableEvents = False

your code...

Application.EnableEvents = True

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top