Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default display cell only if it contains a value

Hi,

I am trying to make an invoice template where rows are used to display name
of product, price etc. The invoice size should automatically be small if
there are only few rows. In other words, there should not be any blank rows
displayed when there is no item.

I should not manually hide blank spaces, but rather want the invoice to
shrink to the number of used rows containing positive values and not even ""
values that may be embedded in formulas.

Regards
sai
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default display cell only if it contains a value

Assign to a button or shape. Based on column A having values

Sub FilterforInvoice()
lr = Cells(Rows.Count, "a").End(xlUp).Row
With Range("a1:a" & lr)
If ActiveSheet.FilterMode Then
.AutoFilter
Else
.AutoFilter Field:=1, Criteria1:="0", visibleDropDown:=False
ActiveSheet.PrintPreview
End If
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Sai Krishna" wrote in message
...
Hi,

I am trying to make an invoice template where rows are used to display
name
of product, price etc. The invoice size should automatically be small if
there are only few rows. In other words, there should not be any blank
rows
displayed when there is no item.

I should not manually hide blank spaces, but rather want the invoice to
shrink to the number of used rows containing positive values and not even
""
values that may be embedded in formulas.

Regards
sai


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 last cell in range with data, display cell address sevi61 Excel Worksheet Functions 14 October 29th 07 08:36 PM
display text in one cell as a number in an adjacent cell in excel Denno New Users to Excel 1 November 16th 06 05:13 PM
Display contents of cell in another cell as part of text string? [email protected] New Users to Excel 3 July 8th 06 07:44 PM
Conditional display - IF cell is blank, display next used row! Patti[_7_] Excel Programming 2 March 28th 06 10:33 PM
Shortcut key to display change the display from displaying cell values to cell formulae Adrian[_7_] Excel Programming 3 September 14th 04 12:07 PM


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