Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings all. I am not good at excel programming, but I figured out how to
add a command button and to record a new macro to assign to its click event. I have a workbook with two worksheets, each having a separate SQL Server 2000 query as the datasource. During the record new macro step I highlighted the first cell in the data range on the first worksheet, then hit DataRefresh to requery the data. Then I highlighted the first cell in the data range of sheet 2 and did the same thing. The button works, but it shows all the steps I included in the record step. Is there a way to refresh every sheet in the workbook at once, with one click of the button, regardless of the source query? The below is what was generated by the macro recorder. Sub Button11_Click() ' ' Button11_Click Macro ' Macro recorded 10/8/2007 by greg snidow ' ' Keyboard Shortcut: Ctrl+d ' Range("A8").Select ActiveWindow.SmallScroll Down:=-9 Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("EWO_VIEW").Select Range("A4").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("VA VIEW").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create refresh button in worksheet to refresh Pivot Table Data | Excel Worksheet Functions | |||
Adding button to worksheet to refresh pivot table data | Excel Worksheet Functions | |||
Refresh Multiple Queries via a Command Button | Excel Programming | |||
refresh data command message | Excel Programming | |||
how to create button commande to refresh data in query in excel 2. | Excel Discussion (Misc queries) |