ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy/Paste Problem (https://www.excelbanter.com/excel-programming/278492-copy-paste-problem.html)

Pete McCosh[_5_]

Copy/Paste Problem
 
JB,

you can't record a macro to do this. What you can do is
edit the recorded version to work the way you want.
In the transcript of your recorded macro you will see the
line
Cells.Find(What:= ...

after that equals, you will see the original string you
searched on when recording the macro. If we assume that
string was "Bill" and, instead, you always want to find
the value in cell A1, then replace
What:="Bill"

with

What:=Range("A1").value

You can now simply amend the contents of cell A1 and run
your macro with gay abandon.

Pete


All times are GMT +1. The time now is 04:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com