#1   Report Post  
Posted to microsoft.public.excel.programming
C3 C3 is offline
external usenet poster
 
Posts: 13
Default Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"