Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro for order forms


Hi everyone

It is my first post here. Ive been consulting this site and it is very
helpful and Ive learned numerous relevant tips.

I want to set up an Order Form (with all items, price etc) but this
document is HUGO (more than 1000 items) and it's a pain in the back to
print.

I need to build a macro that will check every line (to see if there's
anything ordered) and where ever there is units (to keep it) and where
there's no unit, simply hide or delete the row..

let me know if this make any sens
any help would be greatly appreciated

thank you very much in advance..
jim barber


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
jon jon is offline
external usenet poster
 
Posts: 18
Default macro for order forms

try this for whichever row has the empty cells in it:

Range("A1").select
1 Do until IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop

Selection.EntireRow.Delete
ending = ending + 1
If ending 1000 Then
GoTo 2
End If
goto 1

2 end sub

this should go through the do loop and when it hits an
empty cell it will break the loop and delete the row,
then repeat the loop. the ending clause is how many rows
it will delete.

hope it helps
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default macro for order forms

Jim,

Another way (with the units in column H),

'-----

Option Explicit
Sub hideRows()
Range("H:H").SpecialCells(xlCellTypeBlanks).Entire Row.Hidden = True
End Sub

Sub showRows()
Rows.Hidden = False
End Sub

'-----

HTH
Anders Silvén

"jbarber" skrev i meddelandet ...

Hi everyone

It is my first post here. Ive been consulting this site and it is very
helpful and Ive learned numerous relevant tips.

I want to set up an Order Form (with all items, price etc) but this
document is HUGO (more than 1000 items) and it's a pain in the back to
print.

I need to build a macro that will check every line (to see if there's
anything ordered) and where ever there is units (to keep it) and where
there's no unit, simply hide or delete the row..

let me know if this make any sens
any help would be greatly appreciated

thank you very much in advance..
jim barber


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro for order forms


I would approach this very differently.

1) Create your list as you seem to have done.

2) Create an order form on another sheet and use VLookup (possibl
incorporating DataValidation to "pick from list". So in a cell of you
choice you would type/select the product and other details would sel
populate.

3) More advanced using VBA would be a userform with a listbox showin
products to select from

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default macro for order forms

Jim,

The original macro just hides rows in the used range, the unused 60,000+ rows will not print anyway, so I didn't bother about them.

If you must hide *all* empty rows, you can try the addition below.

'-----
Sub hideRows()
On Error GoTo hExit
Range("H:H").SpecialCells(xlCellTypeBlanks).Entire Row.Hidden = True
Range(Rows(Cells(Rows.Count, "H").End(xlUp).Row + 1), _
Rows(Rows.Count)).EntireRow.Hidden = True
hExit:
End Sub
'-----

Regards,
Anders Silvén

"onedaywhen" skrev i meddelandet om...
This didn't work for me. When I had non-blank values in H:H it hid the
blank rows up to the last non-blank cell and none beyond. When I had
all blank values in H:H I got a run-time error.

"Anders S" <anders wrote in message ...
Jim,

Another way (with the units in column H),

'-----

Option Explicit
Sub hideRows()
Range("H:H").SpecialCells(xlCellTypeBlanks).Entire Row.Hidden =
True
End Sub

Sub showRows()
Rows.Hidden = False
End Sub

'-----

HTH
Anders Silv n

"jbarber" skrev i meddelandet
...

Hi everyone

It is my first post here. Ive been consulting this site and it is very
helpful and Ive learned numerous relevant tips.

I want to set up an Order Form (with all items, price etc) but this
document is HUGO (more than 1000 items) and it's a pain in the back to
print.

I need to build a macro that will check every line (to see if there's
anything ordered) and where ever there is units (to keep it) and where
there's no unit, simply hide or delete the row..

let me know if this make any sens
any help would be greatly appreciated

thank you very much in advance..
jim barber


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro for order forms


thanks for all replies.. but maybe I adventured myself in a 'far beyond
my knowledge' situation...

here attached excel document is exactly what I use as an order form.

please see the attached worksheet.
You see there is items ordered in row 5 to 9 and 19 to 23.

in the TOTAL (column L) I want all the rows with a ZERO to be hided! So
I could ONLY print the row with items ordered ...

let me know what you think about it...

thank you very much, I feel like I still can pull this one with your
help...

jim b.
:)


+----------------------------------------------------------------+
| Attachment filename: jbarber_example_excel.xls |
|Download attachment: http://www.excelforum.com/attachment.php?postid=361879|
+----------------------------------------------------------------+

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

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
Forms, fields and tab order foxcole Excel Discussion (Misc queries) 1 March 18th 09 03:09 PM
Need to automatically number order forms in excel upon opening? Mike1 Excel Discussion (Misc queries) 2 May 16th 06 07:59 PM
Forms Buttons for use with macro - recolorable? Ms. Tude New Users to Excel 1 February 20th 06 10:59 PM
Daily Macro to Download Data, Order and paste in order Iarla Excel Worksheet Functions 1 November 17th 04 01:59 PM
Macro for forms function Shawn[_4_] Excel Programming 2 November 11th 03 02:38 AM


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