A macro problem, find and replace

Closed
Vincent - Apr 5, 2009 at 10:52 PM
perham Posts 9 Registration date Saturday March 28, 2009 Status Member Last seen June 18, 2009 - Apr 6, 2009 at 04:37 AM
Hello,
I have a macro which contains the following procedure:

Range("D210:D219,Z210:AA219").Select
Range("Z210").Activate
Application.CutCopyMode = False
Selection.Copy
Windows("test.xls").Activate
Range("D11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True

Range("D286:D295,Z286:AA295").Select
Range("Z286").Activate
Application.CutCopyMode = False
Selection.Copy
Windows("test.xls").Activate
Range("D17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True



How can I use the Find and replace function in visual basic editor so that in the first line (e.g. Range("D210:D219,Z210:AA219").Select ) the letter "D" can be replaced with "B"
without changing the no. and the other text which contains a letter "D". I would like the procedure to be as follows after replacement:

After modification:

Range("B210:B219,Z210:AA219").Select
Range("Z210").Activate
Application.CutCopyMode = False
Selection.Copy
Windows("test.xls").Activate
Range("D11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True

Range("B286:B295,Z286:AA295").Select
Range("Z286").Activate
Application.CutCopyMode = False
Selection.Copy
Windows("test.xls").Activate
Range("D17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True

Thanks a lot
Vincent

1 response

perham Posts 9 Registration date Saturday March 28, 2009 Status Member Last seen June 18, 2009 2
Apr 6, 2009 at 04:37 AM
0