Can anyone help???

mattk918

New Member
Joined
Mar 20, 2009
Messages
22
I want a Macro to run within my Worksheet "Input Sheet" that

Looks at merged cell G7:I7 (don't ask... inherited document that is formatted to hell and has so many links, references and macros that it throws a wobbler if anything changes!) where there is a date.

Then looks down the range AE45:AE409 (contains a column of dates for each day of the year) finds that same date.

Then pastes the value from cell G32 into the column to the right of the date range, i.e. the appropriate cell of AF45:AF409

I am sure that this is childsplay to many out there, but it has got me ready to bang my head against the wall this afternoon!!!

Any help greatfully received

Matt <!-- / message -->
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello,

there are probably many methods to this, heres mine

Code:
Sub COPY_TO_AF()
    Application.ScreenUpdating = False
    MY_VALUE = Range("G7").Value
    Range("AE45").Select
    Do Until ActiveCell.Value = MY_VALUE
        ActiveCell.Offset(1, 0).Select
    Loop
    ActiveCell.Offset(0, 1).Value = Range("G32").Value
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi Matt

Assuming that it will always be G7 and G32, try,

Code:
Sub test()
Cells(44 + Application.Match(CLng(Range("g7").Value), Range("AE45:AE409"), 0), 32) = Range("G32").Value
End Sub

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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