ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   selective cells (https://www.excelbanter.com/excel-worksheet-functions/208698-selective-cells.html)

climate

selective cells
 
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


Sandy Mann

selective cells
 
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


Replace @mailinator.com with @tiscali.co.uk


"climate" wrote in message
...
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





ShaneDevenshire

selective cells
 
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" wrote:

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


climate

selective cells
 
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" wrote:

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" wrote:

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


Sandy Mann

selective cells
 
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


Replace @mailinator.com with @tiscali.co.uk


"climate" wrote in message
...
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" wrote:

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" wrote:

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






All times are GMT +1. The time now is 07:21 PM.

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