Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

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 havent
been able to figure that out as of yet.

Is there a way to restore those annoying line numbers?

Steve



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Restoring Line Numbers

Using Goto statements is very poor coding practice and should not
be used. If I understand your question, you can use code like the
following:

Dim WB As Workbook
For Each WB In Workbooks
If WB.Name < "TheOneYouDoNotWantToSave.xls" Then
WB.Save
End If
Next WB


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"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





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

Chip thanks for the reply, but you see I'm a very old gentleman and that the
way I use t oprogram. Just now trying to get my hands around this VBA coding
and it is very hard for me to get it.

But reading your coding I think that I was forgetting a line, and you just
help me out.

Thanks again,

Steve

"Chip Pearson" wrote:

Using Goto statements is very poor coding practice and should not
be used. If I understand your question, you can use code like the
following:

Dim WB As Workbook
For Each WB In Workbooks
If WB.Name < "TheOneYouDoNotWantToSave.xls" Then
WB.Save
End If
Next WB


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"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






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Restoring Line Numbers


caldog wrote:
Chip thanks for the reply, but you see I'm a very old gentleman and that the
way I use t oprogram. Just now trying to get my hands around this VBA coding
and it is very hard for me to get it.


Hi,
The code fragment you gave brought back memories of programming the
TRS-80 (which my father bought when I was still a high-school student
in the 70s). For years I got away from programming, until I started
writing Excel macros about 5 years ago. I found Walkenbach's small book
"Excel VBA for Dummies" a useful tool for making the transition from
old-style Basic to new-style Basic. After I got through that I was
ready to tackle more ambitious books.

-John Coleman

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Restoring Line Numbers

Hi John thanks for your reply.

I will go and get that book today.

Steve

"John Coleman" wrote:


caldog wrote:
Chip thanks for the reply, but you see I'm a very old gentleman and that the
way I use t oprogram. Just now trying to get my hands around this VBA coding
and it is very hard for me to get it.


Hi,
The code fragment you gave brought back memories of programming the
TRS-80 (which my father bought when I was still a high-school student
in the 70s). For years I got away from programming, until I started
writing Excel macros about 5 years ago. I found Walkenbach's small book
"Excel VBA for Dummies" a useful tool for making the transition from
old-style Basic to new-style Basic. After I got through that I was
ready to tackle more ambitious books.

-John Coleman




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Restoring Line Numbers

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





  #12   Report Post  
Posted to microsoft.public.excel.programming
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






Reply
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
Restoring izmn19 Excel Discussion (Misc queries) 2 April 13th 08 08:17 PM
Restoring Filter peyman Excel Discussion (Misc queries) 1 October 26th 07 01:07 AM
Restoring toolbar No Name New Users to Excel 2 March 8th 07 01:56 PM
Line numbers some numbers are blue some are black nkt122866 Excel Discussion (Misc queries) 2 September 29th 05 09:32 PM
Activating & Restoring Eloy[_2_] Excel Programming 0 October 22nd 04 09:11 PM


All times are GMT +1. The time now is 05:14 PM.

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"