PC Review


Reply
Thread Tools Rate Thread

Clearing an integer variable

 
 
callbr549
Guest
Posts: n/a
 
      17th Nov 2008
I'm building a UserForm for data entry. I use a ComboBox to get a numeric
value and assign it to an integer (call it Prod). I put the value of Prod in
a cell of a worksheet.

If the user does not enter a value for Prod in the UserForm, I want the cell
on the worksheet to be blank. I tried Prod="" at the end of the sub, but that
gives a type mismatch error. I tried Prod=vbNull, but that puts a value of 1
in the cell. I tried Prod.ClearContents and that gave some other error
(don't remember which).

How do I make the value of an integer variable be empty?
 
Reply With Quote
 
 
 
 
callbr549
Guest
Posts: n/a
 
      17th Nov 2008
Thank you. I had forgotten about the "Variant" data type. Your suggestion
appears to do exactly what I wanted.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integer variable is shown &HA =?Utf-8?B?TWlrZSBPS0M=?= Microsoft VB .NET 2 5th Oct 2006 08:10 PM
Concatenating a Text variable with a Long Integer variable =?Utf-8?B?UGF0IERvb2xz?= Microsoft Access Form Coding 2 23rd Mar 2006 01:41 AM
How do I convert an integer variable to a string variable? =?Utf-8?B?ZHVtYmFzcw==?= Microsoft Excel Programming 2 21st May 2004 07:34 PM
Is variable an integer? Otto Moehrbach Microsoft Excel Programming 7 6th Feb 2004 04:31 PM
division of variable integer into best fit integer parts Eddy Microsoft Excel Discussion 7 13th Sep 2003 07:59 PM


Features
 

Advertising
 

Newsgroups
 


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