LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default Excel VBA Formula Help

Hi Experts,

With Range("d10,d11,k10,n10,p10,t11,e12,v10")
If .NumberFormat = "0" Or .NumberFormat = "General" Then Exit Sub
.NumberFormat = "0.0"
Else
.NumberFormat = .NumberFormat & "0"
.NumberFormat = Replace(.NumberFormat, "0000", "000 0")
End If
End With

This is part of a button driven macro.

The problem is the exit sub part is causing the rest of the macro to not be run (not shown)

I have tried to place another macro call after "Then" but I cant get it to work.

It just moans about the ".NumberFormat = "0.0"" part.

I just need it to protect the worksheet if it is going to exit sub because at the end of this macros code I protect the sheet. When it exits, It doesnt ever get to run the code part that protects the sheet at the end.

TIA,

Aaron.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I enter a formula, Excel shows the formula not the results Pat Adams Excel Worksheet Functions 5 April 4th 23 11:18 AM
Excel Formula Guidance. Formula need to determine if cell is popul Matt Excel Programming 0 February 19th 10 07:32 PM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"