View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
caldog caldog is offline
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

Thanks Tom what I was looking for in code. Also by looking at Chip's code,
the light finally came on, I was missing the for... next loop. Once I got
that coded, everthing is working. Not perfect but usable.

Thanks again for everybody's help.

Steve

"Tom Ogilvy" wrote:

Sub SaveBooks()
10 B = Application.Workbooks.Count
20 A = 1
30 Application.Workbooks(A).Activate
40 If UCase(ActiveWorkbook.Name) = "ABCD.XLS" _
Then GoTo 60
50 ActiveWorkbook.Save
60 A = A + 1
70 If A <= B Then GoTo 30

End Sub

worked for me.

--
Regards,
Tom Ogilvy



"caldog" wrote in message
...
Hi Rown,

I'm working with a code that saves open workbooks. My problem is there is
one workbook that I don't want to save, everytime I try to figure out to

use
a if statement, it just dosen't work. It is only looking at the one file

I
don't need to save. It is not even getting to the others at all.

Now if programming the old fashion way by using line numbers in my code I
know how to get around this problem.

Example:

10 If A=1 then
20 Goto 50
30 Else
40 Save Activeworkbook.name ("insert workbook name here")
50 Endif

My problem is step 20, I can't figure out to have system check all open
workbooks, and save them all but one.

Steve-the frustrated man

"Rowan Drummond" wrote:

Hi Steve

It could just be me that is confused <g. What line numbers are you
wanting to restore?

Regards
Rowan

caldog wrote:
Thanks Rown for you reply, but I must be a complete idiot, becasue

those
instructions, confuse me more then help me. O well

Steve

"Rowan Drummond" wrote:


Hi Steve

Do you mean line numbers in the VBE? To do this you would need a COM
addin called MZTools. www.mztools.com. It is free and has a lot of

other
helpful features as well as line numbering your code.

You can't record If statements but have a look in visual basic help.
They are pretty well described.

Hope this helps
Rowan

caldog wrote:

Bump

"caldog" wrote:



Several of you have helped me in the past with code, for that I am

very
grateful for all of your help. However, this VBA is still very hard

for me
to do on my own, with out a lot of help. Now if I could restore the

line
numbers to VBA, then I know that I could do my own coding, or can I

by
recording a Macro, see how to write a statement with the If.End if,

I haven't
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve