Refresh/Update

hakuna

New Member
Joined
Sep 2, 2012
Messages
33
Hi friends,
I dont get the hang of VBA inspite of having learnt C++. :confused:

anyways, i need help in coding, i want to make it possible to refresh a particular sheet on clicking a button. i can create the button and even assign the macro. but the code for macro, to refresh i don't know how to generate the code. :eek:


Thanks in advance!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Here is a macro to refresh all.

Sub RefreshAll()
ActiveWorkbook.RefreshAll
End Sub


In the past, I used this code to automatically run every time I select (activate) a sheet that had with a Pivot Table. It replaces the steps of having to select the Refresh icon from the Data or Pivot Table Ribbons.

Private Sub Worksheet_Activate()
ActiveWorkbook.RefreshAll
End Sub
 
Upvote 0
Here is a macro to refresh all.

Sub RefreshAll()
ActiveWorkbook.RefreshAll
End Sub


In the past, I used this code to automatically run every time I select (activate) a sheet that had with a Pivot Table. It replaces the steps of having to select the Refresh icon from the Data or Pivot Table Ribbons.

Private Sub Worksheet_Activate()
ActiveWorkbook.RefreshAll
End Sub

thanks! :)
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

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