Need help with a macro to look up today's date in a file in a specific sheet & return back values in specific cells within that row

ujjavaldave

New Member
Joined
Mar 19, 2008
Messages
5
Hi

I have several files which I need to run a report for, I'm looking for a macro which can look up the date in Column "V", in workbook xyz worksheet1 & return back values in column A,B,D of the same row.

Thanks in advance
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Is the values you're looking up on the same "Sheet" as the date you are looking for? I assume if this is true you want the values from ABD to show in WXY?

Can you show a copy of your workbook or an example of what it looks like/
 
Last edited:
Upvote 0
Hi I'm sorry I don't have a copy of the workbook available as it's on my works shared drive.

I'll try & explain what I'm trying to achieve to give some more clarity.

I have 4 workbooks which have 2 main sheets where data get's input in daily, workbook A, B, C, D

All of workbooks have a column where the current date is input most likely in different columns.

I've created a 5th workbook to run a report for the work which was done for the current day, so in the 5th workbook I have 4 sheets titled A,B,C,D after my 4 workbooks

What the macro needs to do is Identify the current date in workbook A, sheet1 & return back values from the same row in column A, B, D to my 5th workbook in the respective sheet.

& it has to repeat the same steps in all for of the workbooks

I'll try & get a copy of the file from work so that it's a bit easier to explain

Thanks
 
Upvote 0
Hi

Below is a screen shot of the headings in my excel file

 
Upvote 0
Code:
Sub TodaysRows()
'Move Rows in Sheet1 to worksheet called New
Dim totalrows As Long, row As Long
Cells.Sort key1:=Range("A2")
totalrows = ActiveSheet.UsedRange.Rows.Count

For row = totalrows To 1 Step -1
If (Cells(row, 22).Value = Date) Then
Rows(row).Copy Sheets("NEW").Range("A65536").End(xlUp).Offset(1)
End If
Next row
End Sub

I'm not sure what you are asking. This code should identify today's date in column V as you said and then copy each row with that date in column V to a workbook called New or whatever you want depending on the value. Does this help at all?
 
Upvote 0
Dear Mr MMickle

I tried your code & I get the error as mentioned below

Run-time error '1004':
This operation requires the merged cells to be identically sized

What I'm after is that I have Column "V" where the current date is inputted in my workbook, so for eg:- if the macro finds today's date in cell "V3" I want the data which is in Cells "A3, C3 & T3" to be populated in my report file which is a separate file all together

Also if someone can assist me on how to display an image of my file onto this blog it would be great.

Regards
 
Upvote 0

Forum statistics

Threads
1,223,054
Messages
6,169,834
Members
452,284
Latest member
TKM623

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top