Using Excel
Closed
Charles
-
Jan 9, 2012 at 01:36 AM
TrowaD
TrowaD
- Posts
- 2880
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- May 2, 2022
Related:
- Using Excel
- Transfer data from one excel worksheet to another automatically - Guide
- How to change date format in excel - Guide
- Excel @ in formula ✓ - Forum - Excel
- How to change author name in excel - Guide
- Compare two worksheets and paste differences to another sheet - excel vba free download ✓ - Forum - Excel
1 reply
TrowaD
Jan 17, 2012 at 10:33 AM
- Posts
- 2880
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- May 2, 2022
Jan 17, 2012 at 10:33 AM
Hi Charles,
Don't think this can be done by using a formula, so try this code:
To implement the code, right-click on the sheets tab and select "view code". A new window opens up, now copy-paste the code in the big white field. You can close the newly opened window and check if the code does what you want by entering numbers in C3 of that particular sheet.
Best regards,
Trowa
Don't think this can be done by using a formula, so try this code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim x As Integer If Intersect(Target, Range("C3")) Is Nothing Then Exit Sub x = 11 Do Range("E" & x - 1).Copy Destination:=Range("E" & x) x = x - 1 Loop Until x = 4 Range("C3").Copy Destination:=Range("E4") End Sub
To implement the code, right-click on the sheets tab and select "view code". A new window opens up, now copy-paste the code in the big white field. You can close the newly opened window and check if the code does what you want by entering numbers in C3 of that particular sheet.
Best regards,
Trowa