Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default VB code donation required please!

Can you help a novice and provide some vb code to do the following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date and each
time a match is found to copy that particular rows data (cells B:Y) into
worksheet2 (print). This loop is continued until the whole of column A has
been searched
so basicaly a list of data found matching todays date is pasted to another
sheet.

easy uh !

thanks in advancve
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default VB code donation required please!

Don,
thanks for your reply,
but how do you 'tell' a recoding macro that the dates listed in column A are
to be matched , ie if my lcolumn has aprox 1000 lines of dates, of which 150
have todays date, how do I get the macro (whilst being recorded) to do this.


"Don Guillett" wrote:

we learn by doing so record a macro while you do this. Then come back for
more help

sort by datecopypaste

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
Can you help a novice and provide some vb code to do the following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date and each
time a match is found to copy that particular rows data (cells B:Y) into
worksheet2 (print). This loop is continued until the whole of column A has
been searched
so basicaly a list of data found matching todays date is pasted to another
sheet.

easy uh !

thanks in advancve




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VB code donation required please!

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim j As Long

With Worksheets("Log")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = Date Then
j = j + 1
.Cells(i, "A").Resize(, 24).Copy _
Worksheets("print").Cells(j, "A")
End If
Next i
End With

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Don,
thanks for your reply,
but how do you 'tell' a recoding macro that the dates listed in column A

are
to be matched , ie if my lcolumn has aprox 1000 lines of dates, of which

150
have todays date, how do I get the macro (whilst being recorded) to do

this.


"Don Guillett" wrote:

we learn by doing so record a macro while you do this. Then come back

for
more help

sort by datecopypaste

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
Can you help a novice and provide some vb code to do the following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date and

each
time a match is found to copy that particular rows data (cells B:Y)

into
worksheet2 (print). This loop is continued until the whole of column A

has
been searched
so basicaly a list of data found matching todays date is pasted to

another
sheet.

easy uh !

thanks in advancve






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default VB code donation required please!

Bob,thanks
I input the code and got a
Runtime error 1004
Application-defined or object defined error

uh !!!!!

"Bob Phillips" wrote:

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim j As Long

With Worksheets("Log")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = Date Then
j = j + 1
.Cells(i, "A").Resize(, 24).Copy _
Worksheets("print").Cells(j, "A")
End If
Next i
End With

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Don,
thanks for your reply,
but how do you 'tell' a recoding macro that the dates listed in column A

are
to be matched , ie if my lcolumn has aprox 1000 lines of dates, of which

150
have todays date, how do I get the macro (whilst being recorded) to do

this.


"Don Guillett" wrote:

we learn by doing so record a macro while you do this. Then come back

for
more help

sort by datecopypaste

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
Can you help a novice and provide some vb code to do the following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date and

each
time a match is found to copy that particular rows data (cells B:Y)

into
worksheet2 (print). This loop is continued until the whole of column A

has
been searched
so basicaly a list of data found matching todays date is pasted to

another
sheet.

easy uh !

thanks in advancve








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VB code donation required please!

Anthony,

It works for me okay, although I do notice one logic error in there, but not
one that causes a Runtime error 1004

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim j As Long

With Worksheets("Log")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = Date Then
j = j + 1
.Cells(i, "B").Resize(, 24).Copy _
Worksheets("print").Cells(j, "A")
End If
Next i
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Bob,thanks
I input the code and got a
Runtime error 1004
Application-defined or object defined error

uh !!!!!

"Bob Phillips" wrote:

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim j As Long

With Worksheets("Log")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = Date Then
j = j + 1
.Cells(i, "A").Resize(, 24).Copy _
Worksheets("print").Cells(j, "A")
End If
Next i
End With

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Don,
thanks for your reply,
but how do you 'tell' a recoding macro that the dates listed in column

A
are
to be matched , ie if my lcolumn has aprox 1000 lines of dates, of

which
150
have todays date, how do I get the macro (whilst being recorded) to do

this.


"Don Guillett" wrote:

we learn by doing so record a macro while you do this. Then come

back
for
more help

sort by datecopypaste

--
Don Guillett
SalesAid Software

"Anthony" wrote in message
...
Can you help a novice and provide some vb code to do the

following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date

and
each
time a match is found to copy that particular rows data (cells

B:Y)
into
worksheet2 (print). This loop is continued until the whole of

column A
has
been searched
so basicaly a list of data found matching todays date is pasted to

another
sheet.

easy uh !

thanks in advancve








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default VB code donation required please!

Check your sheet names. They must be Log and print (case sensitive.)

Hope this helps
Rowan

Anthony wrote:
Bob,thanks
I input the code and got a
Runtime error 1004
Application-defined or object defined error

uh !!!!!

"Bob Phillips" wrote:


Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim j As Long

With Worksheets("Log")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = Date Then
j = j + 1
.Cells(i, "A").Resize(, 24).Copy _
Worksheets("print").Cells(j, "A")
End If
Next i
End With

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB code donation required please!

Sub ab()
With Worksheets("Log")
If Application.CountIf(.Columns(1), _
Format(Date, "mm/dd/yyyy")) 0 Then
.Range("A1").CurrentRegion.AutoFilter _
Field:=1, Criteria1:="=" & Date
With .AutoFilter.Range
.Offset(1, 1).Resize( _
.Rows.Count - 1, 24).Copy _
Destination:=Worksheets( _
"Print").Range("A2")
.AutoFilter
End With
End If
End With

End Sub

would be a start. Assumes data table on Log starts in A1.

--
Regards,
Tom Ogilvy



"Anthony" wrote in message
...
Can you help a novice and provide some vb code to do the following...

in worksheet1 (log) column A contains an unlimited number of dates
columns B:Y contain other data.
I want a search made for the whole of column A for 'todays' date and each
time a match is found to copy that particular rows data (cells B:Y) into
worksheet2 (print). This loop is continued until the whole of column A has
been searched
so basicaly a list of data found matching todays date is pasted to another
sheet.

easy uh !

thanks in advancve



Reply
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
Another VB Code Required TGV Excel Discussion (Misc queries) 7 February 7th 09 07:21 AM
VB Code Required TGV Excel Discussion (Misc queries) 3 February 6th 09 05:31 PM
Donation receipt form Montana Excel Worksheet Functions 7 February 12th 08 09:41 PM
donation tracking with sub totals for donor sfwprstn Excel Discussion (Misc queries) 1 February 18th 06 12:41 AM
Code required please Neal Excel Programming 2 January 24th 05 05:27 AM


All times are GMT +1. The time now is 12: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"