PDA

View Full Version : Sleeper: Implied do loop in excel write # statement



tlkrummrey
07-30-2008, 01:08 PM
I cannot get an implied do loop in excel VBA to work. example of what I'm trying is:


write #1, (F(i), i = 1,25)

I want to write the string array F() in the same line as the write statement since at the end of execution of the write satament, a new line (CR/LF) is written to the file. That's why I cannot use a normal do loop with the Write statement inside it. Every time the write statement is encountered and ended, a new line (CR/LF) is inserted into the file. What am I doing wrong or missing??

:help

mdmackillop
07-30-2008, 01:10 PM
Welcome to VBAX.
For clarity, can you post the rest of your code?

tlkrummrey
07-30-2008, 01:17 PM
I suppose I could but I think it would only cloud the issue. I think this is a syntax issue or perhaps the functionality just isn't there in VBA as it was years ago in regular Basic, Fortran, and a host of others.:hi:

Tommy
07-30-2008, 01:23 PM
try this The " " is just to seperate the items in the array


Write #1, Join(F, " ")