View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default refresh data vba question

Jason,

A worksheet has two names, the sheet name that we all know and love, and the
codename. When you look at the sheet objects in the VBE explorer window, you
will see something like 'Sheet1(Sheet1)'. This is the default status, when
the sheet name is changed in Excel, it will look like 'Sheet1(IDS Time
Sheet)'. You can also change the first, and your typical Excel user can't.

To change it, select the workbook in the VBE, and change the Name property
in the properties window.

To use it in VBA, use

Sub Refresh()
Sheet1.RefreshAll
End Sub
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JasonSelf " wrote in message
...
I have this code linked with a button on an excel sheet

Sub Refresh()
Workbooks("IDS Time Sheet.xls").RefreshAll
End Sub

The problem is that the end user will be copying this file and renaming
it so that "IDS Time SHeet.xls" would end up becoming another name like
Username2-4-04.xls or something to that effect. Is there a way to
achieve the same thing no matter what the workbook name would end up
being?

Thanks as always
Jason Self


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