Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Data Validation with division

Hi ,
I would like that when a number is entered in column N the person entering
the column is prompted to enter in format 100,000.00 ( ex 250,225) and then
once the number is entered it is converted in format 250.26 i.e. divided by
1000 and rounded off to two decimal places.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200711/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Data Validation with division

You won't be able to do that with Data Validation alone.

Without DV just format column N as Number with 2 DP and use comma separator.

When user enters 123456.78 it will become 123,456.78

To actually divide the number will have to done via event code.

If using event code why not do the formatting at the same time?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("N:N")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value / 1000
.NumberFormat = "#,##0.00"
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP


On Thu, 29 Nov 2007 15:55:31 GMT, "sidm via OfficeKB.com" <u38329@uwe wrote:

Hi ,
I would like that when a number is entered in column N the person entering
the column is prompted to enter in format 100,000.00 ( ex 250,225) and then
once the number is entered it is converted in format 250.26 i.e. divided by
1000 and rounded off to two decimal places.


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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM
Page Breaks--Controlling so no division of certain data hmeyers Setting up and Configuration of Excel 0 June 14th 05 12:08 AM


All times are GMT +1. The time now is 04:19 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"