LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
TRM TRM is offline
external usenet poster
 
Posts: 9
Default force update/"refresh" of cell & workbook_open?

I have some code on the "worksheet_change" event which checks to see if a
specific cell is being updated. If it is, I want to change the contents of
the adjoining cell. This seems to work, except that in order to actually
view the change (to the adjoining cell) I have to switch to a different sheet
and back. How can I force this refresh/requery. I do not work often in
Excel! I have seen "application.volatile"- and tried it- but if I understand
correctly, this command doesn't work unless the function is performed
in/under the current "target" cell- correct? Otherwise, I haven't found a
whole lot of clues. I am working with Excel 2002; but this will be installed
on to a computer with 2003.

********code for "worksheet_change"**************
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
Dim iColumn As Integer
iRow = Target.Row
iColumn = Target.Column
If ((iColumn = "7") And (iRow = "3")) Then
Application.EnableEvents = False
Cells(1, 1).Value = Date
Cells(8, 3).Value = 0
Application.EnableEvents = True
End If

End Sub


Also- actually, this would be a second question- I would like this same cell
(the adjoining cell) to update upon opening the document. Again, I have code
in place and working properly on "worksheet_activate"- but, if I change it to
"workbook_open"- it does not (appear to) execute.
*********** code snippet on "worksheet_activate"********
Dim intDays As Integer
Dim dtDate As Date
dtDate = Excel.Range("A1")
intDays = Date - dtDate
Application.EnableEvents = False
Excel.Range("H3").Value = intDays


THANKS!
 
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
force entry in cell "B" if entry made in cell "A" Donna Excel Discussion (Misc queries) 1 December 14th 09 02:23 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Automatically click "Update Links" & "Continue" paulharvey[_13_] Excel Programming 0 June 3rd 06 05:35 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 08:17 PM.

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

About Us

"It's about Microsoft Excel"