VBA code to display text in different cells

Zimmerman

Well-known Member
Joined
Jan 22, 2009
Messages
663
Does anybody know of a VBA code that will display text in different cells. what i am trying to do is run a macro that will subtract cell O9 from N9 and in cell P9 have it tell me that I will need to cut however many more (this number comes from the macro) of the text in cell D9.
So the end result would be like this.
Cell O9 has 200
Cell N9 has 100
Cell D9 reads "Fort Floor Support"
Cell P9 would read "You will need to cut 100 more pieces of the Fort Floor Support"

Windows XP
Excel 2003
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
why do you need a macro - Excel formulas are perfectly capable to handle this.
 
Upvote 0
The main reason i want to go with VBA is because somehow and someway the fornulas always seem to get erased or something changed on them. I'm just trying to prevent that from happening. And i know that things can be protected but i'd rather leave the workbook unprotected for the user so in case something does need to be changed they can do it. But when the command button is clicked then it will always go back to the way it was intended.
 
Upvote 0
As an example:

Code:
Sub Wigi()
    [P9] = "You will need to cut " & [O9] - [N9] & " more pieces of the " & [D9]
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,463
Members
452,915
Latest member
hannnahheileen

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