Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default I "DO" have a "DO"

Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no "Do"

The only things I changed since the time it was working are lines of code
between this Do and Loop and I have not entered a "Loop" in there.

....Help?

Also, what is the difference between Do While ... Loop and While ... Wend

Marie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default I "DO" have a "DO"

Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no

"Do"

The only things I changed since the time it was working are lines of

code
between this Do and Loop and I have not entered a "Loop" in there.

...Help?

Also, what is the difference between Do While ... Loop and While ...

Wend

Marie



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default I "DO" have a "DO"

nope

"Frank Kabel" a écrit dans le message de
...
Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no

"Do"

The only things I changed since the time it was working are lines of

code
between this Do and Loop and I have not entered a "Loop" in there.

...Help?

Also, what is the difference between Do While ... Loop and While ...

Wend

Marie





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default I "DO" have a "DO"

Hi
to be honest this answer won't help you to get a more specific response
:-)
How should we help you finding this error if we don't have more
information. So if your macro is not that long post the omitted lines.
I'm (and I think the same is true for Chip) quite sure that there's an
additional line of code (e.g. 'End', 'End if', 'Loop', etc.) which does
NOT have an opening statement

You may check this by yourself by identing each loop / if clause


--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
nope

"Frank Kabel" a écrit dans le message de
...
Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no

"Do"

The only things I changed since the time it was working are lines

of
code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and While

....
Wend

Marie






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default I "DO" have a "DO"

here you go:
I guess my Select Case doesn't have the good syntaxe...

'Déclaration des variables
Dim i As Integer 'compteur
Dim NOCIBC As String ' No du dossier à la CIBC
Dim ND As String ' Notre numero de dossier
Dim Nom As String ' Nom du débiteur
Dim DateO As Date ' Date ouverture
Dim DateR As Date ' Date recouvrement
Dim Montant As Currency ' Montant du recouvrement

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

NOCIBC = Range("B" & i)
ND = Range("C" & i)
Nom = Range("D" & i)
DateO = Range("E" & i)
DateR = Range("F" & i)
Montant = Range("G" & i)

---------------- beginning of new text-----------------------
'Série de tests
Select Case Range("A" & i)
Case "CLS"
Sheets("CLS").Select
Case "CLU"
Sheets("CLU").Select
Case "PLC"
Sheets("PLC").Select

------------------end of new text--------------------------------

'Inscription des données
Range("A14").Select ' Première ligne des données de
facture
Selection.EntireRow.Insert ' Insertion une ligne
Range("A14").FormulaR1C1 = NOCIBC
Range("B14").FormulaR1C1 = ND
Range("C14").FormulaR1C1 = Nom
Range("D14").FormulaR1C1 = DateO
Range("E14").FormulaR1C1 = DateR
Range("G14").FormulaR1C1 = Montant

'Préparation à la prochaine boucle
i = i + 1
Sheets("Principale").Select

Loop
End Sub


"Frank Kabel" a écrit dans le message de
...
Hi
to be honest this answer won't help you to get a more specific response
:-)
How should we help you finding this error if we don't have more
information. So if your macro is not that long post the omitted lines.
I'm (and I think the same is true for Chip) quite sure that there's an
additional line of code (e.g. 'End', 'End if', 'Loop', etc.) which does
NOT have an opening statement

You may check this by yourself by identing each loop / if clause


--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
nope

"Frank Kabel" a écrit dans le message de
...
Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no
"Do"

The only things I changed since the time it was working are lines

of
code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and While

...
Wend

Marie










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default I "DO" have a "DO"

OH.... End Select... *sigh*
Not used to those "End ..." Lol, Used to C++ ;-)
Everything is ok. Thank you anyway!

Marie

"Marie Lavoie" a écrit dans le message de
...
here you go:
I guess my Select Case doesn't have the good syntaxe...

'Déclaration des variables
Dim i As Integer 'compteur
Dim NOCIBC As String ' No du dossier à la CIBC
Dim ND As String ' Notre numero de dossier
Dim Nom As String ' Nom du débiteur
Dim DateO As Date ' Date ouverture
Dim DateR As Date ' Date recouvrement
Dim Montant As Currency ' Montant du recouvrement

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

NOCIBC = Range("B" & i)
ND = Range("C" & i)
Nom = Range("D" & i)
DateO = Range("E" & i)
DateR = Range("F" & i)
Montant = Range("G" & i)

---------------- beginning of new text-----------------------
'Série de tests
Select Case Range("A" & i)
Case "CLS"
Sheets("CLS").Select
Case "CLU"
Sheets("CLU").Select
Case "PLC"
Sheets("PLC").Select

------------------end of new text--------------------------------

'Inscription des données
Range("A14").Select ' Première ligne des données

de
facture
Selection.EntireRow.Insert ' Insertion une ligne
Range("A14").FormulaR1C1 = NOCIBC
Range("B14").FormulaR1C1 = ND
Range("C14").FormulaR1C1 = Nom
Range("D14").FormulaR1C1 = DateO
Range("E14").FormulaR1C1 = DateR
Range("G14").FormulaR1C1 = Montant

'Préparation à la prochaine boucle
i = i + 1
Sheets("Principale").Select

Loop
End Sub


"Frank Kabel" a écrit dans le message de
...
Hi
to be honest this answer won't help you to get a more specific response
:-)
How should we help you finding this error if we don't have more
information. So if your macro is not that long post the omitted lines.
I'm (and I think the same is true for Chip) quite sure that there's an
additional line of code (e.g. 'End', 'End if', 'Loop', etc.) which does
NOT have an opening statement

You may check this by yourself by identing each loop / if clause


--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
nope

"Frank Kabel" a écrit dans le message de
...
Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no
"Do"

The only things I changed since the time it was working are lines

of
code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and While

...
Wend

Marie










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I "DO" have a "DO"

Nope!

or

You never end the select case construct

see original comment:

Could be anything that unbalances your structure. Certainly an error on

your part.

Since the case structure is not terminated, a Loop command is unexpected.


Select Case Range("A" & i)
Case "CLS"
Sheets("CLS").Select
Case "CLU"
Sheets("CLU").Select
Case "PLC"
Sheets("PLC").Select

End Select

--
Regards,
Tom Ogilvy


"Marie Lavoie" wrote in message
...
here you go:
I guess my Select Case doesn't have the good syntaxe...

'Déclaration des variables
Dim i As Integer 'compteur
Dim NOCIBC As String ' No du dossier à la CIBC
Dim ND As String ' Notre numero de dossier
Dim Nom As String ' Nom du débiteur
Dim DateO As Date ' Date ouverture
Dim DateR As Date ' Date recouvrement
Dim Montant As Currency ' Montant du recouvrement

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

NOCIBC = Range("B" & i)
ND = Range("C" & i)
Nom = Range("D" & i)
DateO = Range("E" & i)
DateR = Range("F" & i)
Montant = Range("G" & i)

---------------- beginning of new text-----------------------
'Série de tests
Select Case Range("A" & i)
Case "CLS"
Sheets("CLS").Select
Case "CLU"
Sheets("CLU").Select
Case "PLC"
Sheets("PLC").Select

------------------end of new text--------------------------------

'Inscription des données
Range("A14").Select ' Première ligne des données

de
facture
Selection.EntireRow.Insert ' Insertion une ligne
Range("A14").FormulaR1C1 = NOCIBC
Range("B14").FormulaR1C1 = ND
Range("C14").FormulaR1C1 = Nom
Range("D14").FormulaR1C1 = DateO
Range("E14").FormulaR1C1 = DateR
Range("G14").FormulaR1C1 = Montant

'Préparation à la prochaine boucle
i = i + 1
Sheets("Principale").Select

Loop
End Sub


"Frank Kabel" a écrit dans le message de
...
Hi
to be honest this answer won't help you to get a more specific response
:-)
How should we help you finding this error if we don't have more
information. So if your macro is not that long post the omitted lines.
I'm (and I think the same is true for Chip) quite sure that there's an
additional line of code (e.g. 'End', 'End if', 'Loop', etc.) which does
NOT have an opening statement

You may check this by yourself by identing each loop / if clause


--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
nope

"Frank Kabel" a écrit dans le message de
...
Hi
you probably have an additional loop or other end statement in your
other 'many code lines'

--
Regards
Frank Kabel
Frankfurt, Germany

"Marie Lavoie" schrieb im Newsbeitrag
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no
"Do"

The only things I changed since the time it was working are lines

of
code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and While

...
Wend

Marie










  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default I "DO" have a "DO"

Marie,

Most likely, the error is that you are missing or have an extra
"End If" or other "End" statement in the code that you omitted.


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




"Marie Lavoie" wrote in message
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has

no "Do"

The only things I changed since the time it was working are

lines of code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and

While ... Wend

Marie




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default I "DO" have a "DO"

nope

"Chip Pearson" a écrit dans le message de
...
Marie,

Most likely, the error is that you are missing or have an extra
"End If" or other "End" statement in the code that you omitted.


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




"Marie Lavoie" wrote in message
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has

no "Do"

The only things I changed since the time it was working are

lines of code
between this Do and Loop and I have not entered a "Loop" in

there.

...Help?

Also, what is the difference between Do While ... Loop and

While ... Wend

Marie






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I "DO" have a "DO"

Could be anything that unbalances your structure. Certainly an error on
your part.

See Above

None

--
Regards,
Tom Ogilvy


"Marie Lavoie" wrote in message
...
Hi, I have a macro that was once working...

It looks like this:

Sub LectureCode()

i = 5 'initialization du compteur
Sheets("Principale").Select

'Lecture du code
Do While Range("A" & i) < Empty

(... here I have many code lines...)

Loop

But when I run it, it highlights the word Loop and says it has no "Do"

The only things I changed since the time it was working are lines of code
between this Do and Loop and I have not entered a "Loop" in there.

...Help?

Also, what is the difference between Do While ... Loop and While ... Wend

Marie






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
correct syntax for nesting "if", "and", and "vlookup"....if possib Christine Excel Worksheet Functions 4 January 2nd 09 10:43 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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