Can I write a macro to ask for a specific number?
put a button from the control toolbox toolbar on the sheet. Double click on
it to take you to the click event (or right click and select view code).
Put in code like the below pseudo code:
Private Sub Commandbutton1_Click()
dim ans as Long, rng as Range
ans = application.Inputbox("Enter an integer to format",type:=1)
set rng = cells.Find(ans)
if not rng is nothing then
rng.NumberFormat = "#,##0"
else
msgbox ans & " was not found"
End if
End Sub
now go back to excel and take the sheet out of design mode (click on the
depressed button on the control toolbox toolbar with the ruler and drawing
triangle - or their may be a separate floating toolbar with this same
button).
--
Regards,
Tom Ogilvy
"soconfused" wrote:
I have a worksheet that has numerous columns and rows. I would like to write
a macro looking for a number then format the cell. I would like to set up a
button to do this and ask for a different number each time.
--
DMM
|