Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Userforms - Dealing with zeros and non-entry of data

Hi,

I have a userform where the user enters the percentage complete of various
items. I have a problem dealing with both of the following;
1) When activated, the userform extracts the previous "percent complete"
from the spreadsheet. If the user tabs over the previous number (doesn't
change the value) i get a zero or error message.
2) Because the number entered by the user is divided by 100, if the
"percent complete" is zero, i get a error (but i need the program to accept
zeros as an imput).

I'm currently using the following code for transferring the userform inputs
into the spreadsheet.
Range("PrelimDes").Value = Format((txtPrelimDesComplete.Value / 100),
"#0%")

What code could i use to alleviate my problems? Also, I havent defined my
userform variables. What is an appropriate dim for "percentage" values in
userform textboxes?

Thanks for your help
Troy




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Userforms - Dealing with zeros and non-entry of data

Try:

If IsNumeric(TextBox1) Then
Range("A1").NumberFormat = "#0%"
Range("A1").Value = TextBox1 / 100
End If

--

Vasant

"TroyB" wrote in message
u...
Hi,

I have a userform where the user enters the percentage complete of various
items. I have a problem dealing with both of the following;
1) When activated, the userform extracts the previous "percent

complete"
from the spreadsheet. If the user tabs over the previous number (doesn't
change the value) i get a zero or error message.
2) Because the number entered by the user is divided by 100, if the
"percent complete" is zero, i get a error (but i need the program to

accept
zeros as an imput).

I'm currently using the following code for transferring the userform

inputs
into the spreadsheet.
Range("PrelimDes").Value = Format((txtPrelimDesComplete.Value / 100),
"#0%")

What code could i use to alleviate my problems? Also, I havent defined my
userform variables. What is an appropriate dim for "percentage" values in
userform textboxes?

Thanks for your help
Troy






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Userforms - Dealing with zeros and non-entry of data

Thank you Vasant. The code works great.
These newsgroups are excellent!

Regards,
Troy

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Try:

If IsNumeric(TextBox1) Then
Range("A1").NumberFormat = "#0%"
Range("A1").Value = TextBox1 / 100
End If

--

Vasant

"TroyB" wrote in message
u...
Hi,

I have a userform where the user enters the percentage complete of

various
items. I have a problem dealing with both of the following;
1) When activated, the userform extracts the previous "percent

complete"
from the spreadsheet. If the user tabs over the previous number

(doesn't
change the value) i get a zero or error message.
2) Because the number entered by the user is divided by 100, if the
"percent complete" is zero, i get a error (but i need the program to

accept
zeros as an imput).

I'm currently using the following code for transferring the userform

inputs
into the spreadsheet.
Range("PrelimDes").Value = Format((txtPrelimDesComplete.Value /

100),
"#0%")

What code could i use to alleviate my problems? Also, I havent defined

my
userform variables. What is an appropriate dim for "percentage" values

in
userform textboxes?

Thanks for your help
Troy








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
Making Zeros look like no entry DeeDeeCee Excel Discussion (Misc queries) 5 March 28th 10 12:01 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
automatically prefix cell entry with leading zeros Automatic prefix set with leading zeros Excel Worksheet Functions 2 March 9th 07 02:32 AM
microsoft excel help dealing with data entry forms....please help KD Excel Worksheet Functions 3 December 19th 06 06:12 AM
How to program data entry to avoid zeros or last 5 digit. sevek Excel Discussion (Misc queries) 1 January 17th 06 09:35 PM


All times are GMT +1. The time now is 01:31 AM.

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

About Us

"It's about Microsoft Excel"