Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
DDK DDK is offline
external usenet poster
 
Posts: 3
Default Find first blank row in worksheet to import data from txt file

I am trying to import data into a worksheet on a weekly basis. I need to
access the specific worksheet, find the first blank row on that worksheet to
import the next weeks data into the worksheet. I got the import but not
finding the first blank row and specifying that as the starting ppint for the
imort.
  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Find first blank row in worksheet to import data from txt file

The first empty cell in Column A:

Dim lngRow As Long
With Worksheets("Sheet1")
lngRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
End With

assuming there is nothing in the very last row of Column A. If that is a
concern you could test it:

Dim lngRow As Long
With Worksheets("Sheet1")
If IsEmpty(.Cells(.Rows.Count, 1)) Then
lngRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
Else: MsgBox "No last cell in Column A"
End If
End With

"DDK" wrote:

I am trying to import data into a worksheet on a weekly basis. I need to
access the specific worksheet, find the first blank row on that worksheet to
import the next weeks data into the worksheet. I got the import but not
finding the first blank row and specifying that as the starting ppint for the
imort.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
importing a particular excel worksheet into another excel file dinouk Excel Worksheet Functions 0 August 10th 06 02:03 PM
mail merging 2 workbooks??? Bubba Gump Excel Discussion (Misc queries) 21 August 7th 06 09:13 AM
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"