View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Wood Grafing Wood Grafing is offline
external usenet poster
 
Posts: 57
Default When does the Access query run at worksheet open?

Hello all,

I'm working on an excel file that will get information from a couple cells,
and put that into a msgbox at worksheet open. I have one problem tho, if I
put the code at the Worksheet_Open, it fires before the query is run, and the
msgbox has old info in it. I would like the msgbox to popup without running
a macro, so where do I put the code so it will fire after the query? Any
help is appreciated, and I hope I was clear enough.

Code I'm using:

Dim strTotal, strRes, strUnres As String

'Worksheets("Count").Visible = True
Sheets("Count").Select
Range("C2").Select
'strTotal = ActiveCell.Value
Range("C3").Select
strRes = ActiveCell.Value
Range("C4").Select
strUnres = ActiveCell.Value
'Worksheets("Count").Visible = False

MsgBox "Resolved Issues: " & strRes & Chr(13) _
& "Unresolved Issues: " & strUnres & Chr(13) _
& "Total Issues: " & strTotal, vbOKOnly, "Tallies"