Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default find empty cells in a column then append row that empty cell i

Hi Bernard
I have solved the problem I had with this I had two shets called 2Orders"
and "Results - my final code reads -
Sub Rectangle7_Click()

orders.Activate
lastcell = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For j = 1 To lastcell
If Cells(j, 7) = "" Then
k = k + 1
Rows(j & ":" & j).Copy Sheets("Results").Cells(k, 1)
End If
Next j

End Sub

Many Many thanks for all your help!

"Bernard Liengme" wrote:

This look for blanks in column G and copyies entrie row to Sheet3

Sub ListEmpty()
Sheets("Sheet2").Activate
lastcell = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For j = 1 To lastcell
If Cells(j, 7) = "" Then
k = k + 1
Rows(j & ":" & j).Copy Sheets("Sheet3").Cells(k, 1)
End If
Next j
End Sub

best wsihes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"vbnewbie" wrote in message
...
Thanks for this Bernard it's a good start but I need to display the whole
contents of the row, not just the row numbers, also in a text file rather
than on another sheet.

Hope you can help, or anyone else out there?

Cheers

"Bernard Liengme" wrote:

I am assuming: (1) the column is A, and (2) you want to start at row 1.
This subroutine looks at column A on Sheet2 and on Sheet3 in column A it
lists the row number of every empty cell. The Sheet3 could be copied to a
text file or saved as a TXT file.
best wishes

Sub ListEmpty()
Sheets("Sheet2").Activate
lastcell = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For j = 1 To lastcell
If Cells(j, 1) = "" Then
k = k + 1
Sheets("Sheet3").Cells(k, 1) = j
End If
Next j
End Sub

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"vbnewbie" wrote in message
...
I am trying to read all empty cells in a column then append the rows
that
the
cells are in to a text file using VB6
Microsoft EXCEL 2003






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
Find first empty cell in column TomHull Excel Discussion (Misc queries) 1 November 9th 09 05:16 AM
How to: Find first empty cell in column DW Excel Worksheet Functions 18 October 12th 07 05:57 AM
Delete Rows with Empty Cells with empty column 1 Scott Excel Programming 5 October 2nd 06 11:57 PM
Find a empty cell in next column Michael Excel Discussion (Misc queries) 3 June 15th 05 02:18 PM
How to find next empty cell within a column? Rick Excel Programming 5 May 27th 05 07:25 PM


All times are GMT +1. The time now is 10:13 PM.

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

About Us

"It's about Microsoft Excel"