Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic cell formatting


--------------------------------------------------------------------------------

Hi,

I have a problem with cells formatting. For an unknown reason, currency
numbers that I write in a form I created sometimes don't want to be used
in a VBA division of a range by another. But the VBA code is ok, because
it works most of the time. But sometimes, when I enter values in it, it
seems to be currency values but VBA says incompatible type on the
division line code. So I found a way to solve my problem by formatting
the cell in standard before writing and then changing it in anything I
want after that. So, I ask if there's a way when a user writes in a
cell to automatically activate a cell formating of that cell in
standard format before what he writes actually be in the cells.

I say it that way cause I never fixed my problem when I tried to change
a cells format after it's writen. To give a hint of the nature of the
problem, when I try to change the problematic currency value in simple
number, in the cell format, it says it's a simple number but if you
look at the cell content, it's still currency!

Thx for any help!

Werner


--
Werner
------------------------------------------------------------------------
Werner's Profile: http://www.excelforum.com/member.php...o&userid=24304
View this thread: http://www.excelforum.com/showthread...hreadid=389026

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic cell formatting


I found the solution in another forum. A great code that solves the
problem for good like magic. A big thanks to this guy, Dave Hawley.
Here's the code :


Code:
--------------------


Sub ForceToNumber()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
With wSheet
.Range("IV65536") = vbNullString
.Range("IV65536").Copy
.UsedRange.PasteSpecial xlPasteValues, xlPasteSpecialOperationAdd
End With
Next wSheet
End Sub


--------------------


--
Werner
------------------------------------------------------------------------
Werner's Profile: http://www.excelforum.com/member.php...o&userid=24304
View this thread: http://www.excelforum.com/showthread...hreadid=389026

Reply
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
automatic formatting Larry Gagnon Excel Discussion (Misc queries) 1 March 19th 09 06:25 PM
automatic formatting [email protected] Excel Worksheet Functions 5 March 4th 08 06:59 PM
automatic date formatting Terry Freedman Excel Discussion (Misc queries) 1 October 31st 07 09:40 AM
Automatic formatting help? Mel Excel Discussion (Misc queries) 6 June 20th 06 05:35 PM
Automatic Row Formatting Chris Hughes Excel Discussion (Misc queries) 3 April 14th 05 11:17 PM


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

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"