LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro doesn't refresh

I have a spreadsheet that I'm trying to wakthrough a list of customers and
print a letter and statement for each.

I have a range named 'RowIndex' which is used by VLOOKUP statements and a MS
SQLQuery to merge some information.

The problem is that it loops through the list just fine but even though I
have auto calc on it doesn't seem to refresh the spreadsheet between loops.

Any ideas?

Code I'm using is below.



Sub PrintForms()
Dim StartRow As Integer
Dim EndRow As Integer
Dim Msg As String
Dim i As Integer

Sheets("PastDueList").Activate
StartRow = Range("StartRow")
EndRow = Range("EndRow")

If StartRow EndRow Then
Msg = "ERROR" & vbCrLf & "The starting row must be less than the
ending row!"
MsgBox Msg, vbCritical, APPNAME
End If

For i = StartRow To EndRow
Range("RowIndex") = i
Worksheets("Letter").Activate
ActiveWorkbook.RefreshAll
ActiveSheet.PrintPreview
Worksheets("Statement").Activate
ActiveSheet.PrintOut
Next i
Worksheets("PastDueList").Activate
Range("RowIndex").Select
End Sub


 
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
How do I refresh a macro? MVPMAILROOM Excel Discussion (Misc queries) 1 October 31st 06 06:53 PM
refresh macro Lou Sanderson Excel Discussion (Misc queries) 2 August 24th 06 04:24 PM
refresh macro Lou Sanderson Excel Worksheet Functions 2 August 24th 06 04:24 PM
Refresh macro Jelinek Excel Discussion (Misc queries) 1 February 7th 06 04:30 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM


All times are GMT +1. The time now is 10:36 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"