abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
i have this code works in selection event but not in change event and if is possible amending the code or getting alternative the code select cells or change depend on range ("d11:m22") and show in j23 so i want only this range applies when cell is actived not out side this range
my data
i have this code works in selection event but not in change event and if is possible amending the code or getting alternative the code select cells or change depend on range ("d11:m22") and show in j23 so i want only this range applies when cell is actived not out side this range
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$j$23" Then
Target.Value = ""
Else
[j23].MergeArea = ActiveCell
End If
End Sub
my data
active cell.xlsm | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
D | E | F | G | H | I | J | K | L | M | |||
11 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ||
12 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ||
13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ||
14 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ||
15 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ||
16 | 140 | 148 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | ||
17 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | ||
18 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | ||
19 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | ||
20 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 222 | 228 | ||
21 | 229 | 230 | ||||||||||
22 | numbers | |||||||||||
23 | ||||||||||||
sheet1 |