Home |
Search |
Today's Posts |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You must die laughing at what us morons attempt to do. THANKS MUCH!!
David "Die_Another_Day" wrote: This one was close: ..Range("A" & cnt:"I" & cnt).Copy Sheets("sheet1").Range("A" & nRow) Modified to this: ..Range("A" & cnt & ":I" & cnt).Copy Sheets("sheet1").Range("A" & nRow) Charles David wrote: Gonna keep me waiting huh? LOL!! Any ideas? "Die_Another_Day" wrote: The problem is in this line: If .Range("A" & cnt) = ("FilterCriteria") Then '<<<No working Try this instead: If .Range("A" & cnt) = Range("FilterCriteria").Cells(1) And .Range("A" & cnt) <= Range("FilterCriteria").Cells(2) Then and yes it will copy to the next empty row in Sheet1, Column A Charles David wrote: I was wondering if you could help me as well... I have taken your code and put it into my worksheet. It runs, but I get no results. My criteria are two date ranges which I have given the name "Filtercriteria". I only included the serial dates, not the headings. The filtered data starts on row 7 (which is why I changed the start row to 7) and I want the paste to start on row 2 as I have headings on the sheet1 page. Can you assist me? Sub CopyData() Dim lRow As Long 'Last Row Dim nRow As Long 'Next Row to copy to Dim cnt As Long lRow = Sheets("All_Jobs").Range("A" & Sheets("All_Jobs").Rows.Count).End(xlUp) With Sheets("All_Jobs") For cnt = 7 To lRow '<<<Filtered data starts here If .Range("A" & cnt) = ("FilterCriteria") Then '<<<No working nRow = Sheets("sheet1").Range("A" & _ Sheets("sheet1").Rows.Count).End(xlUp).Offset(1, 0).Row .Range("A" & cnt).Copy Sheets("sheet1").Range("A" & nRow + 1) "<<Will this start on row 2? Need to skip row 1 as it has headings. End If Next End With End Sub Thank you very much! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
run code on opening workbook and apply code to certain sheets | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
option buttons run Click code when value is changed via VBA code | Excel Programming |