Angelo Dundee
Board Regular
- Joined
- Nov 18, 2002
- Messages
- 167
This is a very simple question :-
How do I use visual basic to change the formula in a cell.
For example I want 2 option buttons that change the contents of a cell from mm to inches.
Therefore I require 2 routines that are triggered by option buttons.
These routines will do the following :-
When the mm button is clicked I want Cell A1 :-
format = 1 decimal place
contents = C1
When the inches is clicked I want Cell A1 :-
format = 2 decimal place
contents = C1/25.4
Private Sub OptionButton2_Click()
'American - inches click
Range("A1").Select
Selection.NumberFormat = "0.00"
End Sub
What is the line missing above, which will change the formula in the cell, to C1/25.4 ?
Thanks, Angelo Dundee
ray:
Ali, shall return !!!
How do I use visual basic to change the formula in a cell.
For example I want 2 option buttons that change the contents of a cell from mm to inches.
Therefore I require 2 routines that are triggered by option buttons.
These routines will do the following :-
When the mm button is clicked I want Cell A1 :-
format = 1 decimal place
contents = C1
When the inches is clicked I want Cell A1 :-
format = 2 decimal place
contents = C1/25.4
Private Sub OptionButton2_Click()
'American - inches click
Range("A1").Select
Selection.NumberFormat = "0.00"
End Sub
What is the line missing above, which will change the formula in the cell, to C1/25.4 ?
Thanks, Angelo Dundee
ray:
Ali, shall return !!!