Textboxes

G

Guest

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
 
D

Doug Glancy

Marcotte,

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

hth,

Doug Glancy

Marcotte A said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top