Make it ignore empty fields

  • Thread starter Thread starter Trintrin
  • Start date Start date
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
 
untested, but try something like:

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

HTH

Bruce
 
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
 

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

Back
Top