ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HOW TO CHANGE RANGE (https://www.excelbanter.com/excel-programming/402861-how-change-range.html)

K[_2_]

HOW TO CHANGE RANGE
 
Hi, I have data in coloumns K , L and M and in coloumn N I have
formula "=K1&L1&M1" which actually make the group of values of
coloumns K , L and M. Range B25 to D62 they are blank cells but in
Range O25 to O62 I have same formula which I mentioned above but this
time this making group of values of Range B , C and D like the formula
I have in Range O25 to O62 is
"=B25&C25&D25". I want macro that when i enter value in cells B , C
and D and formula in cell O make group of those values by formula i
want the group value in cell O to match with group values in coloumn N
and if they not matching then give message that its not there.
Someone send me the macro but i dont know how to change the ranges to
achive my goal. Please is there anybody can help. (please see macro
below) Thanks...........

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:C" '<== change to suit


On Error GoTo ws_exit
Application.EnableEvents = False


If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Me.Cells(.Row, "A").Value < "" And _
Me.Cells(.Row, "B").Value < "" And _
Me.Cells(.Row, "C").Value < "" Then
If IsError(Application.Match(Me.Cells(.Row,
"D").Value, Columns(14), 0)) Then
MsgBox "Not matched"
End If
End If
End With
End If


ws_exit:
Application.EnableEvents = True
End Sub


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com