473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Excel Import VBA question

Hi,
my first time doing an excel import. It works. Can close off when I
get to the last field with data, but would like it to keep checking to
see if there is any more data (user has a blank space between data
rows), not just exit
Have tried several things, but not sure how to get back to the top and
loop to the top until the last line is reached.
What I have so far is:

For i = i_from To i_to
i = i + 1
If (excel_ws.Cells(i, 2).Value = "") Then
***how to get back to the top???? (currently is
'goto close_excel' and saves data, exits)
Else
DoCmd.RunSQL "INSERT INTO ...
End If
Next i

May 21 '07 #1
1 1331
Try this,

iLastRowNr = Selection.Cells.Find(What:="*", After:=[A1],
SearchDirection:=xlPrevious).Row
For i = i_from ToiLastRowNr

Filip
"stevenrec" <st****@stevenrec.comwrote in message
news:11*********************@x18g2000prd.googlegro ups.com...
Hi,
my first time doing an excel import. It works. Can close off when I
get to the last field with data, but would like it to keep checking to
see if there is any more data (user has a blank space between data
rows), not just exit
Have tried several things, but not sure how to get back to the top and
loop to the top until the last line is reached.
What I have so far is:

For i = i_from To i_to
i = i + 1
If (excel_ws.Cells(i, 2).Value = "") Then
***how to get back to the top???? (currently is
'goto close_excel' and saves data, exits)
Else
DoCmd.RunSQL "INSERT INTO ...
End If
Next i

May 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
1
by: John Hewitt | last post by:
A 'newbie' question - importing into Access from Excel. Googled the group postings but I can't find the amswer I have a 50 line three column file in Excel that contains Names and Tel numbers....
15
by: daniroy | last post by:
Hello everybody, your help will be very very welcome on a very classic question... I have some Excell Macro background, a little bit of VBA knowledge. I import daily from Internet series of...
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
10
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in...
14
by: cj | last post by:
I want to start a workbook and add sheets to it one at a time. Right now my code opens a workbook and it has 3 sheets alread in it and I don't even know how to move from one to another. Any help...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
15
by: patf | last post by:
Hi - experienced programmer but this is my first Python program. This URL will retrieve an excel spreadsheet containing (that day's) msci stock index returns. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.