Help creating a Macro or Formula

  • Thread starter Thread starter lhernan1219
  • Start date Start date
L

lhernan1219

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.
 
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
 

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

Back
Top