#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Packing List Macro

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Packing List Macro

Just a suggestion...

I'd spend time rearranging the data so that the quantities go in one column.

Then I'd apply Data|Filter|autofilter to that column with the quantities.

You can filter to show non-blanks (or greater than 0) and print that.

It may be easier to implement, too. (And less work that has to be thrown
away???)

MarkT wrote:

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Packing List Macro

Hi Dave,

Thanks for your input, I certainly understand where you are coming from as
that was what I wanted to do as well. However, this spreadsheet is the basis
for about eight other attached worksheets that gather information on pricing,
remanufacturing and inventory. This is a project of mine to do some time in
2007, however I was looking to see if there was some way to do this without
revamping the current layout.

Thanks again for your thoughts!

Mark

"Dave Peterson" wrote:

Just a suggestion...

I'd spend time rearranging the data so that the quantities go in one column.

Then I'd apply Data|Filter|autofilter to that column with the quantities.

You can filter to show non-blanks (or greater than 0) and print that.

It may be easier to implement, too. (And less work that has to be thrown
away???)

MarkT wrote:

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Packing List Macro

Maybe...

Option Explicit
Sub testme()
Dim CurWks As Worksheet
Dim RptWks As Worksheet
Dim iRow As Long
Dim iCol As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim FirstCol As Long
Dim HowManyQtyCols As Long
Dim HowManyColsPerGroup As Long
Dim DestCell As Range
Dim qtyCol As Long

Set CurWks = Worksheets("sheet1")
Set RptWks = Worksheets("sheet2")

'first cell to get data on the report worksheet
Set DestCell = RptWks.Range("A11")

With CurWks
'first column with quantities
FirstCol = 1 'column A

'first row with qty
FirstRow = 6
'use the second column (desc) to get the last row for all columns?
LastRow = .Cells(.Rows.Count, FirstCol + 1).End(xlUp).Row

'4 qty columns
HowManyQtyCols = 4

'how many columns per group
HowManyColsPerGroup = 4

For iCol = 1 To HowManyQtyCols
qtyCol = FirstCol + (HowManyColsPerGroup * (iCol - 1))
For iRow = FirstRow To LastRow
If .Cells(iRow, qtyCol).Value = 0 Then
'do nothing
Else
DestCell.Resize(1, HowManyColsPerGroup).Value _
= .Cells(iRow, qtyCol) _
.Resize(1, HowManyColsPerGroup).Value

'get ready for the next non-zero one
Set DestCell = DestCell.Offset(1, 0)
End If
Next iRow
Next iCol
End With

End Sub


MarkT wrote:

Hi Dave,

Thanks for your input, I certainly understand where you are coming from as
that was what I wanted to do as well. However, this spreadsheet is the basis
for about eight other attached worksheets that gather information on pricing,
remanufacturing and inventory. This is a project of mine to do some time in
2007, however I was looking to see if there was some way to do this without
revamping the current layout.

Thanks again for your thoughts!

Mark

"Dave Peterson" wrote:

Just a suggestion...

I'd spend time rearranging the data so that the quantities go in one column.

Then I'd apply Data|Filter|autofilter to that column with the quantities.

You can filter to show non-blanks (or greater than 0) and print that.

It may be easier to implement, too. (And less work that has to be thrown
away???)

MarkT wrote:

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Packing List Macro

Dave,

I'm new to VBA, so it looks like I will be breaking open my new book from
Walkenhbach - "Excel 2003 Power Programming with VBA" tonight!

I will give your code a try.

"Dave Peterson" wrote:

Maybe...

Option Explicit
Sub testme()
Dim CurWks As Worksheet
Dim RptWks As Worksheet
Dim iRow As Long
Dim iCol As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim FirstCol As Long
Dim HowManyQtyCols As Long
Dim HowManyColsPerGroup As Long
Dim DestCell As Range
Dim qtyCol As Long

Set CurWks = Worksheets("sheet1")
Set RptWks = Worksheets("sheet2")

'first cell to get data on the report worksheet
Set DestCell = RptWks.Range("A11")

With CurWks
'first column with quantities
FirstCol = 1 'column A

'first row with qty
FirstRow = 6
'use the second column (desc) to get the last row for all columns?
LastRow = .Cells(.Rows.Count, FirstCol + 1).End(xlUp).Row

'4 qty columns
HowManyQtyCols = 4

'how many columns per group
HowManyColsPerGroup = 4

For iCol = 1 To HowManyQtyCols
qtyCol = FirstCol + (HowManyColsPerGroup * (iCol - 1))
For iRow = FirstRow To LastRow
If .Cells(iRow, qtyCol).Value = 0 Then
'do nothing
Else
DestCell.Resize(1, HowManyColsPerGroup).Value _
= .Cells(iRow, qtyCol) _
.Resize(1, HowManyColsPerGroup).Value

'get ready for the next non-zero one
Set DestCell = DestCell.Offset(1, 0)
End If
Next iRow
Next iCol
End With

End Sub


MarkT wrote:

Hi Dave,

Thanks for your input, I certainly understand where you are coming from as
that was what I wanted to do as well. However, this spreadsheet is the basis
for about eight other attached worksheets that gather information on pricing,
remanufacturing and inventory. This is a project of mine to do some time in
2007, however I was looking to see if there was some way to do this without
revamping the current layout.

Thanks again for your thoughts!

Mark

"Dave Peterson" wrote:

Just a suggestion...

I'd spend time rearranging the data so that the quantities go in one column.

Then I'd apply Data|Filter|autofilter to that column with the quantities.

You can filter to show non-blanks (or greater than 0) and print that.

It may be easier to implement, too. (And less work that has to be thrown
away???)

MarkT wrote:

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Packing List Macro

Remember to backup often and save before you experiment.

It's easy to close without saving after you've screwed things up, er, modified
in the wrong direction.

MarkT wrote:

Dave,

I'm new to VBA, so it looks like I will be breaking open my new book from
Walkenhbach - "Excel 2003 Power Programming with VBA" tonight!

I will give your code a try.

"Dave Peterson" wrote:

Maybe...

Option Explicit
Sub testme()
Dim CurWks As Worksheet
Dim RptWks As Worksheet
Dim iRow As Long
Dim iCol As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim FirstCol As Long
Dim HowManyQtyCols As Long
Dim HowManyColsPerGroup As Long
Dim DestCell As Range
Dim qtyCol As Long

Set CurWks = Worksheets("sheet1")
Set RptWks = Worksheets("sheet2")

'first cell to get data on the report worksheet
Set DestCell = RptWks.Range("A11")

With CurWks
'first column with quantities
FirstCol = 1 'column A

'first row with qty
FirstRow = 6
'use the second column (desc) to get the last row for all columns?
LastRow = .Cells(.Rows.Count, FirstCol + 1).End(xlUp).Row

'4 qty columns
HowManyQtyCols = 4

'how many columns per group
HowManyColsPerGroup = 4

For iCol = 1 To HowManyQtyCols
qtyCol = FirstCol + (HowManyColsPerGroup * (iCol - 1))
For iRow = FirstRow To LastRow
If .Cells(iRow, qtyCol).Value = 0 Then
'do nothing
Else
DestCell.Resize(1, HowManyColsPerGroup).Value _
= .Cells(iRow, qtyCol) _
.Resize(1, HowManyColsPerGroup).Value

'get ready for the next non-zero one
Set DestCell = DestCell.Offset(1, 0)
End If
Next iRow
Next iCol
End With

End Sub


MarkT wrote:

Hi Dave,

Thanks for your input, I certainly understand where you are coming from as
that was what I wanted to do as well. However, this spreadsheet is the basis
for about eight other attached worksheets that gather information on pricing,
remanufacturing and inventory. This is a project of mine to do some time in
2007, however I was looking to see if there was some way to do this without
revamping the current layout.

Thanks again for your thoughts!

Mark

"Dave Peterson" wrote:

Just a suggestion...

I'd spend time rearranging the data so that the quantities go in one column.

Then I'd apply Data|Filter|autofilter to that column with the quantities.

You can filter to show non-blanks (or greater than 0) and print that.

It may be easier to implement, too. (And less work that has to be thrown
away???)

MarkT wrote:

Hello,

I am trying to create a packing list of items needed for an order. I
currently have a spreadsheet that lists all available items in various sizes
etc. Instead of printing off this entire sheet, which would go accross two
pages and down two pages I would like a form created which will list(print)
only the items selected.

I am running Excel 2003, XP Pro. The current worksheet contains columns for
the item description a blank column for the quantity that the Sales Rep
enters in, along with the cost and selling price of that item. There are
over 200 items. The items are fairly static, in other words, we don't add
parts too frequently, so it's not real dynamic. The set of four columns then
repeats across the width of the sheet with additonal items and information.

I'm looking for a printout of only those items where the Sales Rep has
entered in the quantity. I assume this can be done via a macro, however I am
unsure of the exact langauage to use - something along the lines of:

Look at a list of specific cells for the quantity entered.

If Quantity is non blank, copy description (which will be in a cell directly
to the left of the quantity cell) and the quantity to another worksheet
within the same workbook.

Go to next quantity cell location and repeat until done.

The result would then be my "packing list" which would list only those
items, along with the quantity, on a separate worksheet so that I could print
that off.

The quantity cell locations are in more than one column, and would almost
have to be manually entered in to be checked for quantity in the macro.

At some point in the future I am planning on re-vamping this form so that
the quantities are all in the same column, I assume this task would be much
easier if this were the case.

Thanks in advance for all your help and suggestions!

Mark

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Macro Help (Uppercase multiple ranges?) Ken Excel Discussion (Misc queries) 14 December 2nd 06 07:23 PM
Help needed - creating invoice from packing list (both in excel) [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 10:18 AM
Drop down list macro? soteman Excel Discussion (Misc queries) 1 August 12th 06 01:54 AM
running a macro from a list rufusf Excel Worksheet Functions 0 February 22nd 06 04:38 PM
Data Val list Excel 97 fire macro rgarber50 Excel Discussion (Misc queries) 4 October 9th 05 05:19 PM


All times are GMT +1. The time now is 09:28 PM.

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"