ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros and command buttons (https://www.excelbanter.com/excel-programming/300460-macros-command-buttons.html)

michael

Macros and command buttons
 
I'm trying to set a cell (D33) to read 8% based on the click of a command button (in cell C33)

I've never used Macro's before and can't figure it out. Any help would be appreciated.

Bob Phillips[_6_]

Macros and command buttons
 
Put this in the macro

Range("E1").value = "8%"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael" wrote in message
...
I'm trying to set a cell (D33) to read 8% based on the click of a command

button (in cell C33).

I've never used Macro's before and can't figure it out. Any help would be

appreciated.



Stromma[_5_]

Macros and command buttons
 
Something like:

'CoomandButton
Private Sub CommandButton1_Click()

Range("D33") = Range("C33") * 0.08 & "%"

End Sub

'Worksheet Change
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Range("D33") = Range("C33") * 0.08 & "%"

End Sub

/Roge

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:37 PM.

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