macro that will copy ONLY the value I have in cell I1, and then paste it to another cell based on the cell reference I declared in cell G13

papajups

Board Regular
Joined
Sep 8, 2012
Messages
166
Good day All,


Hope all is well.

Could you please help me have a macro that will copy ONLY the value I have in cell I1, and then paste it to another cell based on the cell reference I declared in cell G13.

For example:

I1 = “expired”
G13 = C38

With this, I would like to see the value ‘expired’ in cell C38 when I run the macro.

Also, if the cell declared in G13 is already pre-occupied with value, then please do not run the macro but throw an error message like “The provided cell number is pre-occupied. Please check and try it again”.


I sincerely hope that you can help me on this. Thank you in advance!


regards,
Papajups
 
Re: macro that will throw an error message if the cell reference I declared in cell G13 is outside of range C25:V74

Probably the easiest way is to add a line to Joe's macro. After the "addy = " line, add this line:

Code:
    If Intersect(Range(addy), Range("C25:V74")) Is Nothing Then GoTo err_chk:

If you still want a DV rule, let me know. But it will probably be long and subject to error.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,195
Latest member
Stevenciu

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