Macro para copiar valor desde fórmula

rolito

New Member
Joined
Jun 14, 2007
Messages
14
Hola, necesito una macro que me escriba el valor 500 según lo que diga la celda A10; por ej:

Si en A10 tengo la fórmula =R10, que la macro escriba el valor 500 en celda R10
Si en A10 tengo la fórmula =J20, que la macro escriba el valor 500 en J20

Necesito hacerlo con macro, muchas gracias!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Code:
sub snb()
  Select case cells(10,1).formula
  Case "=R10" 
     cells(10,18)=500
  Case "=J20"
     cells(20,10)=500
  End select
End sub
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top