Make it ignore empty fields

T

Trintrin

I created a series of text boxes to insert data into a spreadsheet
The only problem is if I leave a box blank it is going to make the
spreadsheet cell blank overwriting previous information. Anyone know
any code to make this not write if there is nothing to write?

ws.Cells(iRow, 1).Value = Me.Text.Value
 
S

swatsp0p

untested, but try something like:

IF Me.Text.Value <> "" THEN
ws.Cells(iRow, 1).Value = Me.Text.Value
end if

HTH

Bruce
 
K

kpahel

How about...

dim hold as integer
hold=1 // Starting row
do while now < later // I usually put my isEmtpy her but if
you have empty cells
// in the way you may want
to just see what the bottom
// cell is an say like a<1500
or something.
if isempty(activecell.value)=false then
ws.cells(a,1).value =me.text.value
a++
else
a++
end if
activecell.offset(1,0).select
loop
 
Top