Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
How to make a macro who will in a first worksheet copy a cell (etc. five digit number) then in second worksheet will find a content of a cell with that number, select a whole row with that number then go back in a first worksheet and paste it. That must work for each time with a different number. I was trying do this, but macro recorded content of that cell and every time when it goes to a search, he searches the same number who is recorded in a first time. Thanx! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is a procedure that will do what I understood you to
mean. You said macro, so I assume you mean you only have one target, and you want it pasted right over what you typed. Try to be a little more specific with your data and your requirements. Sub CopyRow() Dim rngTarget As Range Set rngTarget = Worksheets("Sheet1").Range("A2") Dim rngCopy As Range Set rngCopy = Worksheets("Sheet2").UsedRange.Find (rngTarget.Value, , xlValues, xlWhole).EntireRow rngCopy.Copy rngTarget.PasteSpecial xlPasteAll End Sub HTH. -Brad -----Original Message----- Hi! How to make a macro who will in a first worksheet copy a cell (etc. five digit number) then in second worksheet will find a content of a cell with that number, select a whole row with that number then go back in a first worksheet and paste it. That must work for each time with a different number. I was trying do this, but macro recorded content of that cell and every time when it goes to a search, he searches the same number who is recorded in a first time. Thanx! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |