Vba insert new cell to a dynamic range
Closed
tornado1981
Posts
1
Registration date
Saturday June 8, 2013
Status
Member
Last seen
June 8, 2013
-
Jun 8, 2013 at 06:06 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 10, 2013 at 12:03 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jun 10, 2013 at 12:03 PM
Related:
- Vba insert new cell to a dynamic range
- How to insert a checkmark in word - Guide
- Vba case like - Guide
- How to insert photo in word for resume - Guide
- How to insert watermark in word - Guide
- How to insert @ in a laptop - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jun 10, 2013 at 12:03 PM
Jun 10, 2013 at 12:03 PM
Hi Tornado,
Here you go:
Please implement code by right-clicking the sheets' tab and pasting the code in the big white field.
Best regards,
Trowa
Here you go:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub If Target.Value = "Field1" Then Range("E" & Rows.Count).End(xlUp).Copy Range("E" & Rows.Count).End(xlUp).Offset(1, 0) Range("E" & Rows.Count).End(xlUp).Value = Range("E" & Rows.Count).End(xlUp).Value + 1 End If If Target.Value = "Field2" Then Range("F" & Rows.Count).End(xlUp).Copy Range("F" & Rows.Count).End(xlUp).Offset(1, 0) Range("F" & Rows.Count).End(xlUp).Value = Range("F" & Rows.Count).End(xlUp).Value + 1 End If If Target.Value = "Field3" Then Range("G" & Rows.Count).End(xlUp).Copy Range("G" & Rows.Count).End(xlUp).Offset(1, 0) Range("G" & Rows.Count).End(xlUp).Value = Range("G" & Rows.Count).End(xlUp).Value + 1 End If If Target.Value = "Field4" Then Range("H" & Rows.Count).End(xlUp).Copy Range("H" & Rows.Count).End(xlUp).Offset(1, 0) Range("H" & Rows.Count).End(xlUp).Value = Range("H" & Rows.Count).End(xlUp).Value + 1 End If End Sub
Please implement code by right-clicking the sheets' tab and pasting the code in the big white field.
Best regards,
Trowa