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 -->
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

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
11,978
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,259
Messages
5,600,575
Members
414,390
Latest member
plimbu

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