Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add word to existing text in different worksbooks
Hi,
I'm using a recorded macro which carries out the same set of instructions for about 50 different workbooks. My problem is when I've added a bit more to save having to add a word to existing text manually. The text in each workbook is different but I want to add "Provisional" at the end. When I recorded it I just clicked into the cell and pressed F2 and added text at end but when I looked at the macro it's copying the whole of the line of text. If anyone could help with this that would be brilliant Cheers -- Mifty |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add word to existing text in different worksbooks
Please post the code that you need changed.
Thx, Barb Reinhardt "Mifty" wrote: Hi, I'm using a recorded macro which carries out the same set of instructions for about 50 different workbooks. My problem is when I've added a bit more to save having to add a word to existing text manually. The text in each workbook is different but I want to add "Provisional" at the end. When I recorded it I just clicked into the cell and pressed F2 and added text at end but when I looked at the macro it's copying the whole of the line of text. If anyone could help with this that would be brilliant Cheers -- Mifty |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add word to existing text in different worksbooks
Hi Barb,
I'm just learning (picking it all up from having a go, forums like these and websites) so never sure if I'm doing ok or not. I'd got rid of the lines that were replacing my text so have just re-recorded this bit. In my recorded code it has picked up the name of the organisation whose workbook I recorded the macro on so I have replaced with xxxxx here just in case I breach any confidential stuff (hope that's ok) Application.Run "PERSONAL.XLS!BenchPickIfs" Range("A4:J4").Select ActiveCell.FormulaR1C1 = _ "'Results for 2007 xxxxxxxxxxx [Provisional]" With ActiveCell.Characters(Start:=1, Length:=85).Font .Name = "Lucida Sans" .FontStyle = "Bold" .Size = 8 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With End Sub These are the lines that I have removed ActiveCell.FormulaR1C1 = _ "'Results for 2007 XXXXXXX [Provisional]" So what I want to do is just add [Provisional] after xxxxxx which will be different on each of the workbooks. Not explaining myself too well :-( Is the code after these two lines just formatting that I could delete to tidy the code? Not aiming to do that sort of thing now. Just want usable code but nice to know from someone who understands this stuff. Many thanks -- Mifty "Barb Reinhardt" wrote: Please post the code that you need changed. Thx, Barb Reinhardt "Mifty" wrote: Hi, I'm using a recorded macro which carries out the same set of instructions for about 50 different workbooks. My problem is when I've added a bit more to save having to add a word to existing text manually. The text in each workbook is different but I want to add "Provisional" at the end. When I recorded it I just clicked into the cell and pressed F2 and added text at end but when I looked at the macro it's copying the whole of the line of text. If anyone could help with this that would be brilliant Cheers -- Mifty |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add word to existing text in different worksbooks
Select the cells and run:
Sub prov() For Each r In Selection r.Value = r.Value & " Provisional" Next End Sub -- Gary''s Student - gsnu200752 "Mifty" wrote: Hi, I'm using a recorded macro which carries out the same set of instructions for about 50 different workbooks. My problem is when I've added a bit more to save having to add a word to existing text manually. The text in each workbook is different but I want to add "Provisional" at the end. When I recorded it I just clicked into the cell and pressed F2 and added text at end but when I looked at the macro it's copying the whole of the line of text. If anyone could help with this that would be brilliant Cheers -- Mifty |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add word to existing text in different worksbooks
Many thanks :-)))))
-- Mifty "Gary''s Student" wrote: Select the cells and run: Sub prov() For Each r In Selection r.Value = r.Value & " Provisional" Next End Sub -- Gary''s Student - gsnu200752 "Mifty" wrote: Hi, I'm using a recorded macro which carries out the same set of instructions for about 50 different workbooks. My problem is when I've added a bit more to save having to add a word to existing text manually. The text in each workbook is different but I want to add "Provisional" at the end. When I recorded it I just clicked into the cell and pressed F2 and added text at end but when I looked at the macro it's copying the whole of the line of text. If anyone could help with this that would be brilliant Cheers -- Mifty |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
get information from other worksbooks | Excel Programming | |||
Accessing same cell in multiple worksbooks | Excel Programming | |||
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro | Excel Programming | |||
Open method of worksbooks class failed | Excel Programming | |||
how do I transfer information from excel to an existing word document using a macro | Excel Programming |