Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What is wrong with this macro?
The intent of the macro was to force information into cell(s) once, but allow
the user to change the information if they had better numbers. The macro - works correctly the first time - but it overrides any changes entered by the user. Sub Worksheet_Change(ByVal Target As Range) Dim lookrng1 As Range Dim lookrng2 As Range Dim lookrng3 As Range Dim lookrng4 As Range Dim lookrng5 As Range Dim key2 As String Dim SW As String Application.EnableEvents = True If Left(Range("Prod1").Value, 3) = "LBD" Then SW = "off" ElseIf Left(Range("Prod1").Value, 3) < "LBD" And SW < "used" Then SW = "on" End If If SW = "on" Then Range("d17").Value = Range("c9").Value Range("d19").Value = Range("c9").Value SW = "used" End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vb macro format is wrong | New Users to Excel | |||
What is wrong with this Macro? | Excel Worksheet Functions | |||
What's wrong with this macro? | Excel Programming | |||
What have I done wrong with this Macro??? | Excel Programming | |||
What have I got wrong? (Macro),,, | Excel Programming |