selective cells

C

climate

Hello
Please suppose that, the following is a matrix at my first file and on sheet1.
Column H is numbered irregularly and columns I to BP is labled.

H I J K L ........... BP
age gen weight job tall
245 28 F 42 stud 143
789 14 M 33 stud 111
7700 56 F 63 artist 164
1289 31 F 61 dentist 165
..... ... . .. ........ ...
..... ... . .. ........ ...
I need to a macro, when i input [245,789,7700,...] and [age, job,tall,....]
then related data cell (28,stud,143,.....) copy to test.xls on sheet1 and set
to second row and column I.
Thank's for any help.
best regards
 
S

Sandy Mann

Am I to undrstand that your table stretches from table H1:BP7 ?


If so then try:

=VLOOKUP(7700,H3:BP7,MATCH("Tall",I2:BP2,FALSE)+1,FALSE)

or better to put the 7700 and Tall in say A1 & A2 respectively then use:

=VLOOKUP(A1,H3:BP7,MATCH("A2,I2:BP2,FALSE)+1,FALSE)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

ShaneDevenshire

Hi,

assuming you have at least row 1 and 2 containing somethin in column I of
the Text.xls file:

Sub coppMy()
Dim myRow As Long
myRow = ActiveCell.Row
Range("H" & myRow & ":BP" & myRow).Copy
Workbooks("Text.xls").Sheets("Sheet1").Range("I1").End(xlDown).Offset(1,
0).PasteSpecial
Application.CutCopyMode = False
End Sub
 
C

climate

Hi sandy & shane
Thank's for your responses
Would you please explain your prior response?because not works it correctly
or my be i can't run it.
yours
ShaneDevenshire said:
Hi,

assuming you have at least row 1 and 2 containing somethin in column I of
the Text.xls file:

Sub coppMy()
Dim myRow As Long
myRow = ActiveCell.Row
Range("H" & myRow & ":BP" & myRow).Copy
Workbooks("Text.xls").Sheets("Sheet1").Range("I1").End(xlDown).Offset(1,
0).PasteSpecial
Application.CutCopyMode = False
End Sub


--
Thanks,
Shane Devenshire


climate said:
Hello
Please suppose that, the following is a matrix at my first file and on sheet1.
Column H is numbered irregularly and columns I to BP is labled.

H I J K L ........... BP
age gen weight job tall
245 28 F 42 stud 143
789 14 M 33 stud 111
7700 56 F 63 artist 164
1289 31 F 61 dentist 165
..... ... . .. ........ ...
..... ... . .. ........ ...
I need to a macro, when i input [245,789,7700,...] and [age, job,tall,....]
then related data cell (28,stud,143,.....) copy to test.xls on sheet1 and set
to second row and column I.
Thank's for any help.
best regards
 
S

Sandy Mann

I misread your original post. I will leave it to Shane to talk to you about
his code which does not work for me either unless the Text Workbook is
activated by the code.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk


climate said:
Hi sandy & shane
Thank's for your responses
Would you please explain your prior response?because not works it
correctly
or my be i can't run it.
yours
ShaneDevenshire said:
Hi,

assuming you have at least row 1 and 2 containing somethin in column I of
the Text.xls file:

Sub coppMy()
Dim myRow As Long
myRow = ActiveCell.Row
Range("H" & myRow & ":BP" & myRow).Copy

Workbooks("Text.xls").Sheets("Sheet1").Range("I1").End(xlDown).Offset(1,
0).PasteSpecial
Application.CutCopyMode = False
End Sub


--
Thanks,
Shane Devenshire


climate said:
Hello
Please suppose that, the following is a matrix at my first file and on
sheet1.
Column H is numbered irregularly and columns I to BP is labled.

H I J K L ...........
BP
age gen weight job tall
245 28 F 42 stud 143
789 14 M 33 stud 111
7700 56 F 63 artist 164
1289 31 F 61 dentist 165
..... ... . .. ........
...
..... ... . .. ........
...
I need to a macro, when i input [245,789,7700,...] and [age,
job,tall,....]
then related data cell (28,stud,143,.....) copy to test.xls on sheet1
and set
to second row and column I.
Thank's for any help.
best regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top