Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default RefreshAll Data with VBA

Well, this should be my last question for a little while. I need t
create a button that refreshes all data on a specific sheet (we wil
call it sheet1) I found this Worksheets(2).RefreshAll that is suppose
to do just that. I just don't understand exactly how I specify m
worksheet. The 2 is not the name of any of my sheets but doing
little searching I found that it may be the Index property....I do no
understand how I can determine the index property if that is indeed th
case.

Thanks for your help as always, any input would be greatl
appreciated.

Jason Sel

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default RefreshAll Data with VBA

I don't know where you found that code, but it raises an error for me. The
RefreshAll method is a method of the workbook, not the worksheet.

If it would work, you would use Worksheets("Sheet2").RefreshAll
to refer to a worksheet named Sheet2

If you have querytables on the sheet

Dim qt as QueryTable
for each qt in Worksheets("sheet2").QueryTables
qt.Refresh BackgroundQuery:=False
Next

for pivot Tables
Dim pt as PivotTable
for each pt in Worksheets("Sheet2").PivotTables
pt.RefreshTable
Next

Or if you just want to refresh the whole workbook

Workbooks("Myfile.xls").RefreshAll

--
Regards,
Tom Ogilvy


JasonSelf wrote in message
...
Well, this should be my last question for a little while. I need to
create a button that refreshes all data on a specific sheet (we will
call it sheet1) I found this Worksheets(2).RefreshAll that is supposed
to do just that. I just don't understand exactly how I specify my
worksheet. The 2 is not the name of any of my sheets but doing a
little searching I found that it may be the Index property....I do not
understand how I can determine the index property if that is indeed the
case.

Thanks for your help as always, any input would be greatly
appreciated.

Jason Self


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default RefreshAll Data with VBA

I actually got that sippet of code from searching refreshall in the vb
help. Thanks for the help...doing that worked perfectly, Thanks

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWorkbook.RefreshAll teepee[_3_] Excel Discussion (Misc queries) 0 November 11th 08 02:11 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
Problem with ThisWorkbook.RefreshAll Vick Excel Discussion (Misc queries) 3 September 7th 07 12:26 AM
ActiveWorkbook.RefreshAll nc Excel Discussion (Misc queries) 0 March 21st 06 10:50 AM
ActiveWorkbook.RefreshAll Mark[_22_] Excel Programming 0 October 15th 03 02:22 AM


All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"