ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Import Problem (https://www.excelbanter.com/excel-programming/365682-import-problem.html)

wmureports

Import Problem
 
I am importing data from a lot of .xls files(over 100). The data
imports and goes to the apprioriate location. The problem I am
encountering is that I get blank rows. My spreadsheet will look
similar to this

ID Name Phone
1 Joe 555-5555
2 Joe 555-5555
3 Joe 555-5555


4 Joe 555-5555
5 Joe 555-5555

6 Joe 555-5555

7 Joe 555-5555
8 Joe 555-5555
9 Joe 555-5555

Like that with random empty rows. What would i add to my macro to
ignore rows that are blank???


jetted[_2_]

Import Problem
 

Hi wnureport

You have 2 choices;
1: You can do a sort first
2: You can do a macro
Sub test()
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 2 To rowcount
check_val = Range("a" & i).Value
If check_val < Empty Then
'do something
End If
Next
End Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=556573


jetted[_3_]

Import Problem
 

Hi wnureport

You have 2 choices;
1: You can do a sort first
2: You can do a macro
Sub test()
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 2 To rowcount
check_val = Range("a" & i).Value
If check_val < Empty Then
'do something
End If
Next
End Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=556573


jetted[_4_]

Import Problem
 

Hi wnureport

You have 2 choices;
1: You can do a sort first
2: You can do a macro
Sub test()
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 2 To rowcount
check_val = Range("a" & i).Value
If check_val < Empty Then
'do something
End If
Next
End Su

--
jette
-----------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...fo&userid=1753
View this thread: http://www.excelforum.com/showthread.php?threadid=55657


Tim Williams

Import Problem
 
Where are the blank rows coming from?
Without knowing the source it's difficult to suggest a fix...
Posting code always helps.

--
Tim Williams
Palo Alto, CA


"wmureports" wrote in message ups.com...
I am importing data from a lot of .xls files(over 100). The data
imports and goes to the apprioriate location. The problem I am
encountering is that I get blank rows. My spreadsheet will look
similar to this

ID Name Phone
1 Joe 555-5555
2 Joe 555-5555
3 Joe 555-5555


4 Joe 555-5555
5 Joe 555-5555

6 Joe 555-5555

7 Joe 555-5555
8 Joe 555-5555
9 Joe 555-5555

Like that with random empty rows. What would i add to my macro to
ignore rows that are blank???




wmureports

Import Problem
 
The blank rows are coming from the imported xls files. Each file has a
set number of rows, even if the rows are blank. So its copying all the
rows even if they are blank


Tim Williams wrote:
Where are the blank rows coming from?
Without knowing the source it's difficult to suggest a fix...
Posting code always helps.

--
Tim Williams
Palo Alto, CA


"wmureports" wrote in message ups.com...
I am importing data from a lot of .xls files(over 100). The data
imports and goes to the apprioriate location. The problem I am
encountering is that I get blank rows. My spreadsheet will look
similar to this

ID Name Phone
1 Joe 555-5555
2 Joe 555-5555
3 Joe 555-5555


4 Joe 555-5555
5 Joe 555-5555

6 Joe 555-5555

7 Joe 555-5555
8 Joe 555-5555
9 Joe 555-5555

Like that with random empty rows. What would i add to my macro to
ignore rows that are blank???




All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com