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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
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
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
14,761
Office Version
  1. 365
Platform
  1. Windows
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,751
Members
430,315
Latest member
bobh63

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
Top