Change_Event

H

Hawk

I am trying to change a cell's NumberFormat within the
WorksheetChange_Event. The format is changed, but it is
not reflected in the cell until the next time I change the
cell. Any ideas on how to make the NumberFormat be
applied and used immediately after the cells value is
changed? TIA
 
S

steve

Hawk,

I used the following and the format changed instantly when I hit the Enter
key (using Excel97):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Target.NumberFormat = "00000#"
End Sub
 
H

Hawk

I forgot to mention that I am using Excel 97. It seems to
work for 2000, but not 97...Any ideas for a workaround?
 
T

Tom Ogilvy

It works fine in xl97 if the change is made by editing the cell.

how are you updating your cell?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top