View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Spreadsheet Solutions Spreadsheet Solutions is offline
external usenet poster
 
Posts: 33
Default Sending rows to another worksheet based on value of cells in column A

Lindsey;

You can use code like this.

Do Until IsEmpty(ActiveCell)
If ActiveCell.Offset(0, j).Text = x Then
ActiveCell.EntireRow.Copy
Worksheets("Print").Range("B5").Offset(i, -1)
' -1 to set the pointer on Column A, otherwise copying will fail.
i = i + 1
End If
ActiveCell.Offset(1, 0).Select
Loop

What it does.
It starts in B5 on a certain worksheet.
Untill an empty cell is found in column B, it looks in the next cell to see
if that cellcontents matches x,
where x is some text.
If it does so, the whole row is copied to a worksheet called Print starting
in B5, making sure that the starting position
is the first column so that the whole row fits.

Mark.
--
Rosenkrantz Spreadsheet Solutions
Witkopeend 24
1423 SN
Netherlands
------------------------
E:
W:
www.rosenkrantz.nl
------------------------


"Lindsey M" wrote in message
...
:::Sorry for the duplicate post but didn't receive a reply so am trying
again :o):::

Hi everyone

I have a worksheet that has 7 colmuns worth of data (it relates to team
managers, of which there are approx 10 (name stored in column A) and other
info regarding there team members.
Each team manager is part of a service, e.g. Joe Bloggs is part of
Revenues
so I want all the rows that contain Joe Bloggs in column A to be
transferred
to the worksheet named Revenues.
This needs to be done by code, by poss using a Command Button?
Any ideas on this?

As always, help is extremely appreciated!!

Cheers
Lindsey