ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro that uses a cell value to copy another cell (https://www.excelbanter.com/excel-discussion-misc-queries/188320-macro-uses-cell-value-copy-another-cell.html)

Jeff Jensen

Macro that uses a cell value to copy another cell
 
This is for a game that I'm almost done with. Its hard enough for me to
explain this let alone try to figure out the code for it...

I have entered in Sheet2, range F1:F30 as follows:

F
1 B1
2 F1
3 Z1
4 D1
5 G1
6 AA1
and so on. These are randomly sorted.

In Sheet4, A1:AD1 I have an image in each cell. Those get copied and pasted
somewhere in Sheet1.

Sheet2, F1 is frequently deleted with shift cells up.

I need my macro to copy in Sheet4 the cell that Sheet2, F1 indicates.
Something like:

Sub GetPicture()
Sheets("Sheet4").Range("whatever the value in Sheet2 F1 says").Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

Thank you,

Jeff Jensen

PCLIVE

Macro that uses a cell value to copy another cell
 
Maybe something like this:

Sub GetPicture()
Sheets("Sheet4").Range(Sheets("Sheet2").Range("F1" ).Value).Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

--

"Jeff Jensen" wrote in message
...
This is for a game that I'm almost done with. It's hard enough for me to
explain this let alone try to figure out the code for it...

I have entered in Sheet2, range F1:F30 as follows:

F
1 B1
2 F1
3 Z1
4 D1
5 G1
6 AA1
and so on. These are randomly sorted.

In Sheet4, A1:AD1 I have an image in each cell. Those get copied and
pasted
somewhere in Sheet1.

Sheet2, F1 is frequently deleted with shift cells up.

I need my macro to copy in Sheet4 the cell that Sheet2, F1 indicates.
Something like:

Sub GetPicture()
Sheets("Sheet4").Range("whatever the value in Sheet2 F1 says").Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

Thank you,

Jeff Jensen




Jeff Jensen

Macro that uses a cell value to copy another cell
 
Thank you PCLIVE, it's perfect.

I didn't think it was going to be as basic as that.

Jeff Jensen

"PCLIVE" wrote:

Maybe something like this:

Sub GetPicture()
Sheets("Sheet4").Range(Sheets("Sheet2").Range("F1" ).Value).Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

--

"Jeff Jensen" wrote in message
...
This is for a game that I'm almost done with. It's hard enough for me to
explain this let alone try to figure out the code for it...

I have entered in Sheet2, range F1:F30 as follows:

F
1 B1
2 F1
3 Z1
4 D1
5 G1
6 AA1
and so on. These are randomly sorted.

In Sheet4, A1:AD1 I have an image in each cell. Those get copied and
pasted
somewhere in Sheet1.

Sheet2, F1 is frequently deleted with shift cells up.

I need my macro to copy in Sheet4 the cell that Sheet2, F1 indicates.
Something like:

Sub GetPicture()
Sheets("Sheet4").Range("whatever the value in Sheet2 F1 says").Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

Thank you,

Jeff Jensen





PCLIVE

Macro that uses a cell value to copy another cell
 
You're welcome!

--

"Jeff Jensen" wrote in message
...
Thank you PCLIVE, it's perfect.

I didn't think it was going to be as basic as that.

Jeff Jensen

"PCLIVE" wrote:

Maybe something like this:

Sub GetPicture()
Sheets("Sheet4").Range(Sheets("Sheet2").Range("F1" ).Value).Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

--

"Jeff Jensen" wrote in message
...
This is for a game that I'm almost done with. It's hard enough for me
to
explain this let alone try to figure out the code for it...

I have entered in Sheet2, range F1:F30 as follows:

F
1 B1
2 F1
3 Z1
4 D1
5 G1
6 AA1
and so on. These are randomly sorted.

In Sheet4, A1:AD1 I have an image in each cell. Those get copied and
pasted
somewhere in Sheet1.

Sheet2, F1 is frequently deleted with shift cells up.

I need my macro to copy in Sheet4 the cell that Sheet2, F1 indicates.
Something like:

Sub GetPicture()
Sheets("Sheet4").Range("whatever the value in Sheet2 F1 says").Copy
Sheets("Sheet1").Range("D6").Select
ActiveSheet.Paste
End Sub

Thank you,

Jeff Jensen








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

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