Re: Add to a string to make it continuous
- From: "Tom Ogilvy" <twogilvy@xxxxxxx>
- Date: Sat, 23 Apr 2005 18:30:05 -0400
Don't write to word inside the loop. Build the entire string, then write to
word one time.
--
Regards,
Tom Ogilvy
"Adam" <Adam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:137140B7-7955-439A-A8D8-4E1A0224AF89@xxxxxxxxxxxxxxxx
> This did not seem to work either.
>
> "Don Guillett" wrote:
>
> > try
> > Sub stringem()
> > For Each C In Range("e2:e" & Cells(Rows.Count, "e").End(xlUp).Row)
> > mystring = mystring & C & ","
> > Next
> > MsgBox Left(mystring, Len(mystring) - 1)
> >
> > End Sub
> >
> > --
> > Don Guillett
> > SalesAid Software
> > donaldb@xxxxxxx
> > "Adam" <Adam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:E3ED276D-3D6D-4679-A311-F4BB418D9F76@xxxxxxxxxxxxxxxx
> > > I currently have a spread*** that has an infinate number of rows
> > determined
> > > by the user.
> > >
> > > The code states:
> > >
> > > For row=7 to Worksheets('Example').UsedRange.Row.Count
> > >
> > > String1 = Worksheets("Example").Cells.(Row,1).Value
> > >
> > > Endfor
> > >
> > > Now I am trying to accomplish it to just add to the string opposed to
just
> > > creating a new line each time. This information is finally outputted
to
> > Word.
> > >
> > > For example: What I want
> > > Column
> > >
> > > Apples
> > > Oranges
> > > Peaches
> > >
> > > to look like: Apples, Oranges, Peaches
> > >
> > > What I get:
> > >
> > > Apples, Oranges, Peaches
> > > Apples, Oranges
> > > Apples
> > >
> > > is the current output. Any suggestions? Thanks
> > >
> > >
> >
> >
> >
.
- References:
- Add to a string to make it continuous
- From: Adam
- Re: Add to a string to make it continuous
- From: Don Guillett
- Re: Add to a string to make it continuous
- From: Adam
- Add to a string to make it continuous
- Prev by Date: Re: User Form Interface .... really a simple question!
- Next by Date: Re: Stop prompt for password when Excel closes
- Previous by thread: Re: Add to a string to make it continuous
- Next by thread: Runtime error 91 when assigning range
- Index(es):