Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I remove extra blank lines in a column when I print? | Excel Discussion (Misc queries) | |||
Print only if Cell is non-blank | Excel Programming | |||
Cut & Paste into column only if column cell is blank. | Excel Programming | |||
How to stop print in blank cell? | Excel Programming | |||
If a cell is blank do no let a user print or save? | Excel Worksheet Functions |