ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   I am looking for help on a formula (https://www.excelbanter.com/excel-worksheet-functions/29987-i-am-looking-help-formula.html)

voyager via OfficeKB.com

I am looking for help on a formula
 
Ok, I usually can get around problems with formulas, but this one is
beating ym brain to a pulp.

Anyone knows how to make the following happen?

Using sheet1, I want to transfer the entire line of text to another sheet,
using my customer names. That way, I can keep track of who ordered what
and when, and how much was paid for it, instead of jumbling it on one
sheet. The process would have me creat about 15 different sheet to track
my customer's activities.

Than you

Bernie Deitrick

Keep it on one sheet, and use data filters to show just the customer that
you are interested in. Much better technique, less prone to errors.

If you must have separate sheets, try the macro below.

HTH,
Bernie
MS Excel MVP

Sub ExportDatabaseToSeparateSheets()
'Export is based on the value in the desired column
Dim myCell As Range
Dim mySht As Worksheet
Dim myName As String
Dim myArea As Range
Dim myShtName As String
Dim KeyCol As Integer

myShtName = ActiveSheet.Name
KeyCol = InputBox("What column # within database to use as key?")

Set myArea = ActiveCell.CurrentRegion.Columns(KeyCol).Offset(1, 0).Cells

Set myArea = myArea.Resize(myArea.Rows.Count - 1, 1)

For Each myCell In myArea
On Error GoTo NoSheet
myName = Worksheets(myCell.Value).Name
GoTo SheetExists:
NoSheet:
Set mySht = Worksheets.Add(befo=Worksheets(1))
mySht.Name = myCell.Value
With myCell.CurrentRegion
.AutoFilter Field:=KeyCol, Criteria1:=myCell.Value
.SpecialCells(xlCellTypeVisible).Copy _
mySht.Range("A1")
mySht.Cells.EntireColumn.AutoFit
.AutoFilter
End With
Resume
SheetExists:
Next myCell

End Sub


"voyager via OfficeKB.com" wrote in message
...
Ok, I usually can get around problems with formulas, but this one is
beating ym brain to a pulp.

Anyone knows how to make the following happen?

Using sheet1, I want to transfer the entire line of text to another sheet,
using my customer names. That way, I can keep track of who ordered what
and when, and how much was paid for it, instead of jumbling it on one
sheet. The process would have me creat about 15 different sheet to track
my customer's activities.

Than you





All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com