ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refresh worksheet code (https://www.excelbanter.com/excel-programming/337790-refresh-worksheet-code.html)

nowfal[_44_]

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


Norman Jones

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




nowfal[_45_]

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



All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com