PC Review


Reply
Thread Tools Rate Thread

copy data where exact match

 
 
djssuk
Guest
Posts: n/a
 
      15th Jul 2004
I have two spreadsheets.

Spreadsheet 1 has reference numbers R1 to R100 in column b and goin
down the rows.
Spreadhseet 2 has reference numbers R1 to R100 in column b and goin
down the rows.

Colums b-h contains the same column names in both spreadhseets bu
different data.

I want to be able to click on a button on spreadsheet one next to on
of the rows (one button for each row and therefore, each reference) an
for it to load spreadsheet two and for the button to find an exac
match on spreadsheet two and copy the data from spreadhseet one on t
spreadhseet two, overt the existing data for the match.

For instance, if row one had a button, I would click on the button an
if the reference in the column A is R1, the button would look fo
reference R1 on spreadhseet two and copy the contents from column B t
H from spreadhseet one over the data in spreadsheet two for referenc
R1, columns B to H.

Anyone have any VBA code I could use please... please help..

--
Message posted from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
OZDOC1050
Guest
Posts: n/a
 
      15th Jul 2004
This may help you out, you will need only one button on sheet 1 and you will
need to leave cell a1 in sheet 2 available ( you can adjust to suit and use
a hidden cell ), you can also set the macro with a short cut key so you do
not need any buttons at all.

edit sheet names to suit ( these are just 1 and 2 in the example )

to work it simply click on the cell in col b you wish to transfer and run
the macro, there may be better ways but it should get you started.

R
Pete


Sub COPYME()
If ActiveCell.Column <> 2 Or ActiveCell.Row > 100 Then
MsgBox " Please select the data in column B rows 1 - 100"
Exit Sub
End If
Application.ScreenUpdating = False
Sheets("2").Range("A1").Value = ActiveCell.Row - 1
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Resize(numRows + 0, numColumns + 6).Select
Selection.Copy
Sheets("2").Select
Range("B1").Select
ActiveCell.Offset(Range("A1").Value, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("1").Select
Range("A1").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub


--
(][ This Email has been scanned by Norton AntiVirus. ][)
"djssuk >" <<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have two spreadsheets.
>
> Spreadsheet 1 has reference numbers R1 to R100 in column b and going
> down the rows.
> Spreadhseet 2 has reference numbers R1 to R100 in column b and going
> down the rows.
>
> Colums b-h contains the same column names in both spreadhseets but
> different data.
>
> I want to be able to click on a button on spreadsheet one next to one
> of the rows (one button for each row and therefore, each reference) and
> for it to load spreadsheet two and for the button to find an exact
> match on spreadsheet two and copy the data from spreadhseet one on to
> spreadhseet two, overt the existing data for the match.
>
> For instance, if row one had a button, I would click on the button and
> if the reference in the column A is R1, the button would look for
> reference R1 on spreadhseet two and copy the contents from column B to
> H from spreadhseet one over the data in spreadsheet two for reference
> R1, columns B to H.
>
> Anyone have any VBA code I could use please... please help...
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>



 
Reply With Quote
 
djssuk
Guest
Posts: n/a
 
      16th Jul 2004
Thank you very much Pete, I will try it later today.

I am very grateful for your response either way.

Thanks again

--
Message posted from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
look up and match exact data is adjacent column Craig Microsoft Excel New Users 1 15th Oct 2009 08:41 PM
urgent data recovery needs drive with exact p/n match ..... helpanyone?? goinggonehq@gmail.com Computer Hardware 1 28th Apr 2008 03:41 PM
urgent data recovery needs exact part match .... help anyone??? goinggonehq@gmail.com Storage Devices 1 28th Apr 2008 11:56 AM
File comparison program to ensure exact match source-copy MoiMeme Freeware 3 6th May 2005 02:13 PM
MATCH function - 2 columns w/ SIMILAR, not EXACT data =?Utf-8?B?SmFuZQ==?= Microsoft Excel Worksheet Functions 3 5th Mar 2005 03:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:05 AM.