View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
somethinglikeant somethinglikeant is offline
external usenet poster
 
Posts: 94
Default Copy rows with unique values to another sheet

vic

not as short as i would like but this might be a good building block to
start with

Sub CopyOver()

Worksheets("B").Select: [A2].Select: qmark = ActiveCell.Address
qletter = "N"

Worksheets("A").Select: [A2].Select
Do Until IsEmpty(ActiveCell)
If UCase(Left(ActiveCell.Value, 1)) = qletter Then
Rows(ActiveCell.Row).Copy Sheets("B").Range(qmark)
Sheets("B").Select: ActiveCell.Offset(1, 0).Select: qmark =
ActiveCell.Address
Sheets("A").Select
End If
ActiveCell.Offset(1, 0).Select
Loop

End Sub

change the variable qletter to the letter you require to be copied

any probs give us a shout

http://www.excel-ant.co.uk




vmed wrote:
Thanking you in advance for any help. Using Excel 2003. I have a workbook
with 2 sheets. Sheet "A" has 4 culumns with unique data, about 400 rows. The
cells in column "A" of SHEET "A" contain data that starts with a letter then
is follow by numbers (i.e. N584452 or C325412). The second sheet (B) has just
a header. I have been trying to create a macro (macro novice) that will look
in a column ("A") of sheet A for a cell that starts with a certain letter
(i.e. "N"), then copy that complete row to the other sheet (B) starting in
row A2.

Thanks,
Vic
:)