View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Newbie help needed please...

Use this instead
Sub copymonth()
Set ss = Sheets("checks")
Set ds = Sheets("sheet4")
slr = ss.Cells(Rows.Count, 1).End(xlUp).Row
dlr = ds.Cells(Rows.Count, 1).End(xlUp).Row + 1
ss.Cells(2, 1).Resize(slr, 2).Copy ds.Cells(dlr, 1)
ds.Columns.AutoFit
End Sub



On Oct 12, 7:38*am, Don Guillett wrote:
A bit more information?
Will the source sheet only have the current months data?

You say "based on another value within the same sheet "
Does that refer to the month desired or the number of days in the
month.
Here is a simple macro
Sub copymonth()
Set ss = Sheets("checks")
Set ds = Sheets("sheet4")
slr = ss.Cells(Rows.Count, 1).End(xlUp).Row
dlr = ds.Cells(Rows.Count, 1).End(xlUp).Row + 1
ss.Range(Cells(2, 1), Cells(slr, 2)).Copy ds.Cells(dlr, 1)
ds.Columns.AutoFit
End Sub

On Oct 12, 6:57*am, ML wrote:







Hello


I need help as I am not confident in VB although I am keen to learn what
I can.


I would like to copy a range of cells from 2 columns ( which is A2 to B
32 or A2 to slightly less B 29 depending on how many days there are in
the month ), based on another value within the same sheet ( sheet 1 to
another sheet 2.


The cells or the rows of cells in Columns A & B need to be copied if
Column C = Y


The rows in sheets 1 & 2 start at row 2 as I have a header in row 1.


It is only one sheet to another and although sheet 1 will be almost the
same range each time, sheet 2 will need to have each new set of values
appended to the next available empty row.


I appreciate your time and help.


Mark