Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
[translated by google]

Hi all, I have a problem. I have a program that needs to read values ​​from an Excel spreadsheet, I have no problems except for blank cells, in fact, not knowing how many rows there are, I thought of a loop to find the first empty row but I vb generates an error under I'll post the offending code, surely will be a bullshit that escapes me.
Thank you all for the help.


[original post]
Salve a tutti, avrei un problemino. ho un programma che deve leggere dei valori da un foglio di Excel, non ho problemi tranne per le celle vuote, infatti non sapendo quante righe ci sono, ho pensato ad un ciclo per individuare la prima riga vuota ma vb mi genera un errore, sotto vi posto il codice incriminato, sicuramente sarà una cavolata che mi sfugge.
Grazie a tutti per l'aiuto.

VB
While FoglioExcel.Cells(I, 1).value.tostring <> ""
    NumRigheFoglio = NumRigheFoglio + 1
    I = I + 1
End While


grazie
Posted
Updated 17-Jun-13 23:27pm
v3
Comments
Leo Chapiro 18-Jun-13 4:50am    
Have translated to english - pls do it next time by yourself, dude ;)

1 solution

You should probably use (is just a guess, since you did not report the exact error message):
VB
While Not FoglioExcel.Cells(I, 1).Value Is Nothing
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900