Help with a macro to recalculate the file and then run few macros.

Sakshi0206

New Member
Joined
Feb 27, 2015
Messages
28
Hi,

I have a file with few sheets. I have created different macros on all the sheets accept Sheet 1.

Now on sheet 1 i want to create a drop down. I want that every time the value in the drop down is changed the file is recalculated. After the recalculation is completed i want it to run few macros i created on other sheets.

The Macro i am trying on Sheet1 (not modules) is:

Private Sub Worksheet_CurrencyChange(ByVal Target As Range)


If Target.Address = "$C$11" Then
Calculate
Call CurrencyPL
Call CurrencyCFS
Call CurrencyBS
Call CurrencyLoans
Call CurrencyLoans1
End If


End Sub

It is not doing anything. I have tried to create a separate macro to calculate the file and call it here but it is also not working.

Can anyone help me with this?
 
No the file is still not recalculating and i am still getting the compile error. it was not the extra End if i guess. There is still some problem in this macro
 
Upvote 0
The same compile error?

Are you sure that these macros exist? And are you sure they are all in a standard code module (Insert > Module from the VBE) and no where else?

Code:
    Call macro1
    Call CurrencyPL
    Call CurrencyCFS
    Call CurrencyBS
    Call CurrencyLoans
    Call CurrencyLoans1

You may need to upload the file to a file sharing site (like dropbox) and share the link here.
 
Upvote 0
yes i have created them in a module. They are working fine if i run them by going to macro menu. Is it possible that i have limited to specific sheets that they are not working in the worksheet macro? and what about the macro1. Why the file is not recalculating?
 
Upvote 0
yes i have created them in a module. They are working fine if i run them by going to macro menu. Is it possible that i have limited to specific sheets that they are not working in the worksheet macro?

I think we need to see the workbook.

and what about the macro1. Why the file is not recalculating?

You haven't posted the code for macro1 - but if the change event isn't even compiling then macro1 isn't getting called.
 
Upvote 0
UPDATE:

You need to remove the Private part from your sub names.

This:
Code:
Sub CurrencyPL()

Instead of:
Code:
Private Sub CurrencyPL()
 
Upvote 0
Macro1 is simple calculate. And its still not calculating and is still showing the compile error even after i removed Private from the macros.
 
Upvote 0
Macro1 is simple calculate. And its still not calculating and is still showing the compile error even after i removed Private from the macros.

It is impossible to comment on Macro1 because you have not posted the code!

On the compile error - remove any sensitive data and put the workbook on a file sharing site (like dropbox) and share the link here.
 
Upvote 0
The Macro1 is:

Sub Macro1()
'
' Macro1 Macro
'


'
Calculate
End Sub


I tried it again i am getting few errors in the Call CurrencyPL i think i will try solving it first. If you find any fault in the macro do let me know.

Thanks
 
Upvote 0
So the compile error is sorted now?

I suggest you get your other macros sorted and re-visit macro1 later.
 
Upvote 0

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