Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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 |
#2
![]() |
|||
|
|||
![]()
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 |
#3
![]() |
|||
|
|||
![]()
Anyone have a suggestion?
|
#4
![]() |
|||
|
|||
![]()
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. On 7/27/05 1:41 PM, "SKW" wrote: Anyone have a suggestion? -- Daiya Mitchell, MVP Mac/Word Word FAQ: http://www.word.mvps.org/ MacWord Tips: http://www.word.mvps.org/MacWordNew/ What's an MVP? A volunteer! Read the FAQ: http://mvp.support.microsoft.com/ |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Table in a Form | Tables | |||
Macro Button Won't Stay on Toolbar | Microsoft Word Help | |||
Possible bug when recording a Word Macro | Microsoft Word Help | |||
Running document macro from server | New Users | |||
2000 to 2002 macro and "Could not open macro storage" | Mailmerge |