Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default refresh worksheet code


Hi,
I Would like to know, how can i refresh a worksheet code with in a
standard macro.
i mean i wanted to add a line of code inside the standard macro to
refresh the worksheet code. Eagerly waiting for reply.
with regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=397347

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default refresh worksheet code

Hi Nowfal,

To run a worksheet procedure from a standard module, it is necessary to
change the worksheet procedure's declaration from Private ( the default) to
Public.

This done, try something like:

'========================
Sub Tester01()

Dim WB As Workbook
Const sStr As String = "Sheet1" '<<===== CHANGE

Set WB = Workbooks("MyNewTest.xls") '<<===== CHANGE

WB.Sheets(sStr).Worksheet_Calculate

End Sub

'<<========================

You may prefer, however, to consider moving the 'refesh' code portion from
the worksheet procedure to a sub in a standard module, adding a call in the
worksheet event code to the new sub. With this scenario, the 'refresh' code
sub can be run on demand like any other procedure in a standard module.

---
Regards,
Norman



"nowfal" wrote in
message ...

Hi,
I Would like to know, how can i refresh a worksheet code with in a
standard macro.
i mean i wanted to add a line of code inside the standard macro to
refresh the worksheet code. Eagerly waiting for reply.
with regards
nowfal


--
nowfal
------------------------------------------------------------------------
nowfal's Profile:
http://www.excelforum.com/member.php...o&userid=10003
View this thread: http://www.excelforum.com/showthread...hreadid=397347



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default refresh worksheet code


Thanks Norman, I will try your opinion and comeback if any problem i
there

--
nowfa
-----------------------------------------------------------------------
nowfal's Profile: http://www.excelforum.com/member.php...fo&userid=1000
View this thread: http://www.excelforum.com/showthread.php?threadid=39734

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
VBA code to refresh Child Pivot Table HKS Excel Discussion (Misc queries) 0 May 7th 08 07:49 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Code To Refresh Query Table Carl Excel Discussion (Misc queries) 0 December 8th 06 01:23 AM
Wait for Pivot Refresh before continuing Code Execution Dan Excel Programming 0 May 11th 05 06:12 PM
Code to refresh macro once monthly Rcar Excel Programming 7 September 15th 03 11:14 PM


All times are GMT +1. The time now is 09:03 AM.

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"