LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default help with vba code please

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
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM


All times are GMT +1. The time now is 04:37 PM.

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"