Its been a while....Help with inserting formula when cell changes

melewie

Board Regular
Joined
Nov 21, 2008
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Hi All, been a while since I've posted here managed to avoid excel and all forms of IT for the past 5 years (it's been blissful :ROFLMAO:) however here I am at a desk staring at many many spreadsheets.

I am trying to create a downtime log of sorts, what I am trying to achieve is when the user inputs the Item number in column C, I would then like to run a vlookup in column L against another worksheet in the workbook. So far I have this
Code:
Private Sub Worksheet_Change(ByVal Target As Range)    Dim KeyCells As Range


    Set KeyCells = Range("C1:C2000")
    
    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
           Is Nothing Then
'put this bloody formula in cell L whatever the row number was changed "=VLOOKUP(RC[-9],'Production Standards'!C[-11]:C[-9],3,FALSE)"
        MsgBox "it seems to work!!!"
       
    End If
End Sub

Which seems to work identifying when the value in a cell in column C changes.. however I can't figure out how to then tell excel to run a vlookup in column L... it's amazing how much you can forget :eek:

Any help is hugely appreciated

Lewie
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You could use this:

Target.Offset(0, 9).FormulaR1C1 = "=VLOOKUP(RC[-9],'Production Standards'!C[-11]:C[-9],3,FALSE)"
 
Upvote 0
You could use this:

Target.Offset(0, 9).FormulaR1C1 = "=VLOOKUP(RC[-9],'Production Standards'!C[-11]:C[-9],3,FALSE)"

Cheers Steve...the fish, exactly what I was trying to do.

much gratitude to your fishy self!!! :LOL:
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

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