Thread: Null Values
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Blondie[_2_] Blondie[_2_] is offline
external usenet poster
 
Posts: 1
Default Null Values


wrote:
Hi,

I have written a series of macros which insert rows in a database.
Each macro inserts one line with data from the spreadsheet.

I want to avoid sending null rows to the database, but I need to allow
for up to 20 rows to be transferred to the database at a time, when
there may be any number between 1 and 20 to be updated weekly.

Does anyone know of a way to do this? This is the first time I have
used VBA, I have some knowledge of java. Is there an 'if' statement
that can be used in VBA?

Thanks for any help.

:)



Yes there is an IF statement
IF x
THEN y
ELSE z
END IF

also there are
DO x
WHILE y
LOOP,

or
SELECT CASE x
CASE IS y
CASE IS z...
END SELECT.

see
http://visualbasic.about.com/od/lear...cvbsbs0704.htm for
a better description, select case is the nicest looking one if there
are several choices.