ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help creating a Macro or Formula (https://www.excelbanter.com/excel-programming/306731-help-creating-macro-formula.html)

[email protected]

Help creating a Macro or Formula
 
I am trying to convert a Quattro Pro formula attached to
a button that is as follows {blockvalues sheet1:G35,@@
("K10")}. This formula copies the value of Cell G35
located in sheet1 and paste the value in Sheet2 in a
column determined by Cell K10. The formula in Cell K10
is ="sheet2:G"&A5. As the entry in Cell A5 is changed so
does the cell address for the values to be pasted.
Example Cell A5 has a value of 1
Cell K10 will show an address of Sheet2:G1
If Cell A5 has a value of 2
Cell K10 will show Sheet:G2, etc.
The trouble that I am having is how to tell the macro or
formula to copy cell G35 then go to cell K10 to find out
where to paste the results in Sheet2 column G.

Mike Fogleman

Help creating a Macro or Formula
 
Put this macro in a regular code module and assign it to the button:

Sub paste()
Dim r As Long
r = Sheet2.Range("A5").Value
Sheet2.Range("G" & r).Value = Sheet1.Range("G35").Value
End Sub

Cheers...Mike F
" wrote in
message ...
I am trying to convert a Quattro Pro formula attached to
a button that is as follows {blockvalues sheet1:G35,@@
("K10")}. This formula copies the value of Cell G35
located in sheet1 and paste the value in Sheet2 in a
column determined by Cell K10. The formula in Cell K10
is ="sheet2:G"&A5. As the entry in Cell A5 is changed so
does the cell address for the values to be pasted.
Example Cell A5 has a value of 1
Cell K10 will show an address of Sheet2:G1
If Cell A5 has a value of 2
Cell K10 will show Sheet:G2, etc.
The trouble that I am having is how to tell the macro or
formula to copy cell G35 then go to cell K10 to find out
where to paste the results in Sheet2 column G.





All times are GMT +1. The time now is 12:26 AM.

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