Drag formula down depending on number in particular cell
Closed
Gerben69
Posts
1
Registration date
Monday May 15, 2017
Status
Member
Last seen
May 15, 2017
-
May 15, 2017 at 08:46 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - May 15, 2017 at 10:44 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - May 15, 2017 at 10:44 AM
Related:
- Drag formula down depending on number in particular cell
- Number to words in excel formula - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
- Excel grade formula - Guide
- Number to words in word formula - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
May 15, 2017 at 10:44 AM
May 15, 2017 at 10:44 AM
Hi Gerben,
The following code will do as requested:
Place the code in a standard module and run the code manually or create a shortcut for it (do this in the display macro screen Alt+F8, after choosing options).
Or when you want to run the code automatically when you confirm the entry in P1 then place the following code in the sheet module:
Best regards,
Trowa
The following code will do as requested:
Sub RunMe() Range("P2").AutoFill Destination:=Range("P2:P" & Range("P1").Value + 1) End Sub
Place the code in a standard module and run the code manually or create a shortcut for it (do this in the display macro screen Alt+F8, after choosing options).
Or when you want to run the code automatically when you confirm the entry in P1 then place the following code in the sheet module:
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("P1")) Is Nothing Then Exit Sub Range("P2").AutoFill Destination:=Range("P2:P" & Target.Value + 1) End Sub
Best regards,
Trowa