Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Print row when cell in one column blank

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print row when cell in one column blank

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Print row when cell in one column blank

Joel,
One further step:

If BLANK cells
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Application.quit

If NO BLANK cells
Continue macro

Thanks

"Joel" wrote:

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print row when cell in one column blank

LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & LastRow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks = 0 Then Exit Sub


"Helmut" wrote:

Joel,
One further step:

If BLANK cells
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Application.quit

If NO BLANK cells
Continue macro

Thanks

"Joel" wrote:

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Print row when cell in one column blank

Joel,
I input your suggestion like this:
------------------------------------
' Print names where DEPARTMENT CODE is missing & quit without saving

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

lastrow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & lastrow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks = 0 Then Exit Sub
---------------------------
It prints the rows with blanks, but it just continues macro. It should 'quit
excel'.
Help please

"Joel" wrote:

LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & LastRow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks = 0 Then Exit Sub


"Helmut" wrote:

Joel,
One further step:

If BLANK cells
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Application.quit

If NO BLANK cells
Continue macro

Thanks

"Joel" wrote:

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Print row when cell in one column blank

Joel,
it's ok now, I changed :
If blanks = 0 Then Exit Sub
to
If blanks 0 Then Application.quit

But, how can I quit WITHOUT prompt, just quit without saving?

Helmut

"Joel" wrote:

LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & LastRow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks = 0 Then Exit Sub


"Helmut" wrote:

Joel,
One further step:

If BLANK cells
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Application.quit

If NO BLANK cells
Continue macro

Thanks

"Joel" wrote:

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Print row when cell in one column blank

Try this code

------------------------------------
' Print names where DEPARTMENT CODE is missing & quit without saving
lastrow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & lastrow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks 0 Then
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut
thisworkbook.close savechanges:=False
end if



"Helmut" wrote:

Joel,
it's ok now, I changed :
If blanks = 0 Then Exit Sub
to
If blanks 0 Then Application.quit

But, how can I quit WITHOUT prompt, just quit without saving?

Helmut

"Joel" wrote:

LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set searchrange = Range("C1:C" & LastRow)

blanks = WorksheetFunction.CountBlank(searchrange)
If blanks = 0 Then Exit Sub


"Helmut" wrote:

Joel,
One further step:

If BLANK cells
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Application.quit

If NO BLANK cells
Continue macro

Thanks

"Joel" wrote:

try this easy code

Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Select
Selection.PrintOut

"Helmut" wrote:

I have the following:
Column A B C
123456781 name1 473
123456782 name2 471
123456783 name3
123456784 name4 453
123456785 name5
123456786 name6 451

The whole RANGE = "Employees"

Where C = BLANK I would like to PRINT values in A and B and quit application
without saving

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
How do I remove extra blank lines in a column when I print? Nancy Excel Discussion (Misc queries) 1 June 7th 07 06:18 PM
Print only if Cell is non-blank Eric Excel Programming 1 September 26th 06 03:46 PM
Cut & Paste into column only if column cell is blank. [email protected][_2_] Excel Programming 0 June 22nd 06 09:02 PM
How to stop print in blank cell? Wind54Surfer Excel Programming 0 February 3rd 06 08:00 PM
If a cell is blank do no let a user print or save? Havenstar Excel Worksheet Functions 12 July 18th 05 06:32 PM


All times are GMT +1. The time now is 04:05 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"