Compile Error: Next Without for

R

Remco

OK guys,

What is it I am doing wrong. I get a compile error (Next without For)
on the following piece of VBA:

For i = 2 To Lengte
If MyArray(i) <> " " Then
TekstOut(j) = MyArray(i)
j = j + 1
Else
k = i - 1
If MyArray(k) = " " Then
j = j + 1
Else
TekstOut(j) = MyArray(i)
j = j + 1
End
End
Next

Do you have clue?

TIA, Remco
 
C

Chip Pearson

Remco,

Change your "End" statements to "End If".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top