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: 407
Default macro doesn't work after downloading office updates?

Below is a simple macro that I got mostly from you fine folks, particularly
Tom O, as I recall. It worked flawlessly. Then, I added a line that has it
skip the i=16 case. It then worked flawlessly too. Yet, today, when I try
to run it in a revised file, it gives me a "compile error: Next without For"
at that very statement I added that skips the i=16 case. I then went back
to a file that I am pretty certain is the first file with that change and it
bombed out the same way. I also notice that though it seems to bomb out at
i=16, it didn't do the i=7 case either. That seems odd although, perhaps,
that is the way compile errors work - they tell you where it will bomb
without actually performing the operations prior to when it will bomb. Can
someone confirm that?

In any event, is there something different in my computer or EXCEL setup
that can be causing this error. I did go to the Microsoft site a few days
ago and added SP2 and SP3 plus all the other recommended things to my Office
XP (EXCEL 2002) setup - could that be it? If so, can someone tell me how to
fix this macro to work?

Thanks!
Dean

Sub DataTablesClearAndSetup()

'recorded 2/1/2007 by Dean
'edited for looping courtesy of TO on 2-2-07

Dim i As Long
Dim rng As Range

Sheets("InputSummary").Select
ActiveSheet.Unprotect

If Len(Trim(Range("N23"))) = 0 Then Exit Sub
Select Case Range("N23")
Case "Promote"
Set rng = Range("E12")
Case "Catch-Up"
Set rng = Range("F12")
Case "1st Hurdle"
Set rng = Range("B11")
Case "Sub-Line"
Set rng = Range("J15")
Case "Structures"
Set rng = Range("B9")
End Select
For i = 7 To 124 Step 9
If i = 16 Then Next i ' this used to be the net IRR table which is now
computed from fee loss
Application.Goto Reference:="R" & i & "C15"
ActiveCell.Range("A1:A5").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
ActiveCell.Offset(-1, -1).Range("A1:A6").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Table RowInput:=Range("P2"), ColumnInput:=rng

Next i
Range("N1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True
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
downloading excel from Office home and Student Downloading Excel New Users to Excel 1 March 25th 10 08:08 AM
Missing programs after downloading open office Spymandalinus Setting up and Configuration of Excel 1 January 11th 08 07:47 PM
Problems with Excel 2003 after downloading Office SP1 Kristy Excel Discussion (Misc queries) 0 February 22nd 05 06:13 PM
MY EXEL/WORD OFFICE 2000 IS RUNNING VERY SLOW AFTER DOWNLOADING U. STEVE CAMPBELL Excel Discussion (Misc queries) 1 December 7th 04 05:59 PM
Downloading updates a message box shows up saying SKU011.CAB file. office Excel Programming 0 October 18th 04 09:03 PM


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