Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 217
Default Extracting data from large worksheet

Hi all

I have a worksheet consisting of staff names in column A and the branch they
work at in Column B. (There are approximately 400 branches, each with
various numbers of staff).

I need to create a separate worksheet for each branch containing their
members of staff.

I have started to do this by using an Advanced Filter and using the relevant
Department name as the Criteria, however, as there are over 400 branches, it
is going to take me hours. I thought it would be easier to use Import
External Data and then I could use a Parameter to show each Branch on
separate pages, however, when I get to the end of the Wizard, it gives me an
Error message.

CAn anybody think of an easier way of doing this? I'm sure there is one....

Thank you.

Louise
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 217
Default Extracting data from large worksheet

sorry, something I did miss off. I need the final worksheets to look like:

Name of Branch

Joe Bloggs
Fred Smith
karen Jones etc......

THank you.

"Louise" wrote:

Hi all

I have a worksheet consisting of staff names in column A and the branch they
work at in Column B. (There are approximately 400 branches, each with
various numbers of staff).

I need to create a separate worksheet for each branch containing their
members of staff.

I have started to do this by using an Advanced Filter and using the relevant
Department name as the Criteria, however, as there are over 400 branches, it
is going to take me hours. I thought it would be easier to use Import
External Data and then I could use a Parameter to show each Branch on
separate pages, however, when I get to the end of the Wizard, it gives me an
Error message.

CAn anybody think of an easier way of doing this? I'm sure there is one....

Thank you.

Louise

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Extracting data from large worksheet

cODE?

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long
Dim iNextRow As Long
Dim cell As Range
Dim Sh As Worksheet

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
Set Sh = Nothing
On Error Resume Next
Set Sh = Worksheets(.Cells(i, "B").Value)
On Error GoTo 0
If Sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name =
..Cells(i, "B").Value
iNextRow = 1
Else
iNextRow = Worksheets(.Cells(i,
"B").Value).Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
Worksheets(.Cells(i, "B").Value).Cells(iNextRow, "A").Value =
..Cells(i, "A").Value
Next i
End With

End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Louise" wrote in message
...
sorry, something I did miss off. I need the final worksheets to look
like:

Name of Branch

Joe Bloggs
Fred Smith
karen Jones etc......

THank you.

"Louise" wrote:

Hi all

I have a worksheet consisting of staff names in column A and the branch
they
work at in Column B. (There are approximately 400 branches, each with
various numbers of staff).

I need to create a separate worksheet for each branch containing their
members of staff.

I have started to do this by using an Advanced Filter and using the
relevant
Department name as the Criteria, however, as there are over 400 branches,
it
is going to take me hours. I thought it would be easier to use Import
External Data and then I could use a Parameter to show each Branch on
separate pages, however, when I get to the end of the Wizard, it gives me
an
Error message.

CAn anybody think of an easier way of doing this? I'm sure there is
one....

Thank you.

Louise



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 217
Default Extracting data from large worksheet

Bob
Thanks for the reply.
Not quite sure how to tackle this?? Do I enter all this code onto the
original worksheet and make copies of it??? I'm not familiar with VBA

Thanks.

"Bob Phillips" wrote:

cODE?

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long
Dim iNextRow As Long
Dim cell As Range
Dim Sh As Worksheet

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
Set Sh = Nothing
On Error Resume Next
Set Sh = Worksheets(.Cells(i, "B").Value)
On Error GoTo 0
If Sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name =
..Cells(i, "B").Value
iNextRow = 1
Else
iNextRow = Worksheets(.Cells(i,
"B").Value).Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
Worksheets(.Cells(i, "B").Value).Cells(iNextRow, "A").Value =
..Cells(i, "A").Value
Next i
End With

End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Louise" wrote in message
...
sorry, something I did miss off. I need the final worksheets to look
like:

Name of Branch

Joe Bloggs
Fred Smith
karen Jones etc......

THank you.

"Louise" wrote:

Hi all

I have a worksheet consisting of staff names in column A and the branch
they
work at in Column B. (There are approximately 400 branches, each with
various numbers of staff).

I need to create a separate worksheet for each branch containing their
members of staff.

I have started to do this by using an Advanced Filter and using the
relevant
Department name as the Criteria, however, as there are over 400 branches,
it
is going to take me hours. I thought it would be easier to use Import
External Data and then I could use a Parameter to show each Branch on
separate pages, however, when I get to the end of the Wizard, it gives me
an
Error message.

CAn anybody think of an easier way of doing this? I'm sure there is
one....

Thank you.

Louise




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Extracting data from large worksheet

No. Put the code in a standard code module and run it.

To add the code.
Go into the VB IDE, Alt-F11.
Open a new module, menu InsertModule
Paste the code into there.

Go back to Excel and run it.
Go to Excel. Alt-F11
Menu ToolsMacroMacros..., select the macro from the list
Click Run.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Louise" wrote in message
...
Bob
Thanks for the reply.
Not quite sure how to tackle this?? Do I enter all this code onto the
original worksheet and make copies of it??? I'm not familiar with VBA

Thanks.

"Bob Phillips" wrote:

cODE?

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long
Dim iNextRow As Long
Dim cell As Range
Dim Sh As Worksheet

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
Set Sh = Nothing
On Error Resume Next
Set Sh = Worksheets(.Cells(i, "B").Value)
On Error GoTo 0
If Sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name
=
..Cells(i, "B").Value
iNextRow = 1
Else
iNextRow = Worksheets(.Cells(i,
"B").Value).Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
Worksheets(.Cells(i, "B").Value).Cells(iNextRow, "A").Value =
..Cells(i, "A").Value
Next i
End With

End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Louise" wrote in message
...
sorry, something I did miss off. I need the final worksheets to look
like:

Name of Branch

Joe Bloggs
Fred Smith
karen Jones etc......

THank you.

"Louise" wrote:

Hi all

I have a worksheet consisting of staff names in column A and the
branch
they
work at in Column B. (There are approximately 400 branches, each with
various numbers of staff).

I need to create a separate worksheet for each branch containing their
members of staff.

I have started to do this by using an Advanced Filter and using the
relevant
Department name as the Criteria, however, as there are over 400
branches,
it
is going to take me hours. I thought it would be easier to use Import
External Data and then I could use a Parameter to show each Branch on
separate pages, however, when I get to the end of the Wizard, it gives
me
an
Error message.

CAn anybody think of an easier way of doing this? I'm sure there is
one....

Thank you.

Louise






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
Extracting information from large worksheet Louise Excel Worksheet Functions 6 October 10th 06 10:39 AM
Ignoring Rows When Extracting Data From One Worksheet To Another Jim J. Excel Worksheet Functions 2 May 8th 06 04:55 PM
Extracting data from one Worsheet to Another Worksheet with common link value Edwin Mashiringwani Excel Discussion (Misc queries) 1 November 25th 05 03:14 AM
Extracting data from a client worksheet to create an invoice Jacques E. Bouchard Excel Discussion (Misc queries) 1 May 8th 05 07:13 AM
Extracting same column from large number of workbooks BillC Excel Worksheet Functions 3 February 18th 05 09:01 PM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"