Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Textboxes | Excel Discussion (Misc queries) | |||
tab between several textboxes | Excel Worksheet Functions | |||
textboxes | Excel Programming | |||
userform textboxes again | Excel Programming | |||
Userfrom textboxes | Excel Programming |