Repost - Macro Help.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I posted previously but I cannot seem to find the post, so here I go again.

I am trying to write a macro to do the following:

1. Create a New Word File
2. Paste a Table from Excel
3. Select the Table
4. Format the Table
5. Search the cells in column 2 and add the text "Elevation: " at the
beginning of any cell that has text in it.

Now, I have written this macro and everything is working fine except for
step number 5. I cannot seem to generate the code needed to search through
the cells and add the text only to the cells that have text in them already,
as I do not want "Elevation: " to appear in empty cells. Any help or
suggestions are greatly appreciated.

SKW
 
I just realized that I wasn't exactly clear in what i wanted step 5 to do. So
here is some clarification.

(I'm not too clear with the code jargon, so please forgive the wording)

IF cell = empty THEN go to the next cell, unless this is the last cell, then
go to the next step.
Else
Homekey, Type "Elevation: "
Repeat this step.

Basically: I'd like it to first check and see if there is text in the cell.
If there is, then I would like it to insert that text and then repeat on the
next cell down in the column, unless that is the last cell in the column, in
which case I would like it to go to the next step of the macro. If it is
empty, I would like it to go to the next cell in the column and repeat unless
the it is the last cell in the column, in which case I would like it to go to
the next step in the macro. Thanks.

SKW
 
You'd probably get a faster and better response posting in a group with
Programming or VBA in the name (as well as Word in the name), as that's
where the macro experts hang out.

Also, be sure to state your version of Word--also, no one can figure out why
the code doesn't work if you don't show them your code.
 

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

Back
Top