#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Textboxes

I have a userform with multiple (90) textboxes. The user enters data into some of them, and then that data is transferred to the spreadsheet. (The textboxes are not linked directly to cells). However, I do not want to transfer the data onto the spreadsheet for those textboxes that the user leaves empty. I have tried both of the following, but neither work.

For i = 1 To 90
Application.StatusBar = "Adding Data from Textbox" & i & " to spreadsheet."
ProgressPercent = Round(i / 90 * 100, 0)
fmProgress.pcProgress ProgressPercent
If Not IsEmpty(Controls("Textbox" & i).Value) Then
SheetToEnter.Cells(CurrentDateRow, ArrayOfColNums(i)) _
= Controls("Textbox" & i).Value
End If
Next i

and the same thing with IsNull in place of IsEmpty. I have also tried "0" and "< 0". Any ideas?

TIA
Marcotte
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Textboxes

Marcotte,

If Controls("Textbox" & i).Value < "" Then

hth,

Doug Glancy

"Marcotte A" wrote in message
...
I have a userform with multiple (90) textboxes. The user enters data into

some of them, and then that data is transferred to the spreadsheet. (The
textboxes are not linked directly to cells). However, I do not want to
transfer the data onto the spreadsheet for those textboxes that the user
leaves empty. I have tried both of the following, but neither work.

For i = 1 To 90
Application.StatusBar = "Adding Data from Textbox" & i & " to

spreadsheet."
ProgressPercent = Round(i / 90 * 100, 0)
fmProgress.pcProgress ProgressPercent
If Not IsEmpty(Controls("Textbox" & i).Value) Then
SheetToEnter.Cells(CurrentDateRow, ArrayOfColNums(i)) _
= Controls("Textbox" & i).Value
End If
Next i

and the same thing with IsNull in place of IsEmpty. I have also tried

"0" and "< 0". Any ideas?

TIA
Marcotte



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Textboxes

tyvm - it has the added benefit of speeding the code way up too :)

"Doug Glancy" wrote:

Marcotte,

If Controls("Textbox" & i).Value < "" Then

hth,

Doug Glancy

"Marcotte A" wrote in message
...
I have a userform with multiple (90) textboxes. The user enters data into

some of them, and then that data is transferred to the spreadsheet. (The
textboxes are not linked directly to cells). However, I do not want to
transfer the data onto the spreadsheet for those textboxes that the user
leaves empty. I have tried both of the following, but neither work.

For i = 1 To 90
Application.StatusBar = "Adding Data from Textbox" & i & " to

spreadsheet."
ProgressPercent = Round(i / 90 * 100, 0)
fmProgress.pcProgress ProgressPercent
If Not IsEmpty(Controls("Textbox" & i).Value) Then
SheetToEnter.Cells(CurrentDateRow, ArrayOfColNums(i)) _
= Controls("Textbox" & i).Value
End If
Next i

and the same thing with IsNull in place of IsEmpty. I have also tried

"0" and "< 0". Any ideas?

TIA
Marcotte




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
Textboxes SAL Excel Discussion (Misc queries) 2 July 13th 07 12:24 AM
tab between several textboxes Kim Excel Worksheet Functions 0 May 9th 05 04:08 PM
textboxes libby Excel Programming 5 April 13th 04 06:32 PM
userform textboxes again Jo[_6_] Excel Programming 4 October 21st 03 07:25 PM
Userfrom textboxes Jo[_6_] Excel Programming 2 October 21st 03 06:56 PM


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