Macro to repeat a row n times
Closed
Shorouq
Posts
2
Registration date
Friday October 30, 2015
Status
Member
Last seen
October 31, 2015
-
Oct 30, 2015 at 10:40 AM
Shorouq Posts 2 Registration date Friday October 30, 2015 Status Member Last seen October 31, 2015 - Oct 31, 2015 at 04:00 AM
Shorouq Posts 2 Registration date Friday October 30, 2015 Status Member Last seen October 31, 2015 - Oct 31, 2015 at 04:00 AM
Related:
- Macro to repeat a row n times
- Saints row 2 cheats - Guide
- Times attack - Download - Children
- How to delete a row in a table in word - Guide
- Spell number in excel without macro - Guide
- The system time is invalid. this may be a result of a loss in battery power ✓ - CPU & Desktop Forum
2 responses
So post the code that you have, and we can help. We cannot provide you with a turn key solution but can help when stuck.
Are you familiar with IF....Then? How about For Loops?
If N !=0 {
FOR var t = 0 to N {
DO_THE_ACTION
}
NEXT T
}
Please understand, this code is not VBA, or basic. but just a wireframe of how the logic could go. I am excited to see what you have!
I have said it once, I will say it again. IT!
Are you familiar with IF....Then? How about For Loops?
If N !=0 {
FOR var t = 0 to N {
DO_THE_ACTION
}
NEXT T
}
Please understand, this code is not VBA, or basic. but just a wireframe of how the logic could go. I am excited to see what you have!
I have said it once, I will say it again. IT!
Shorouq
Posts
2
Registration date
Friday October 30, 2015
Status
Member
Last seen
October 31, 2015
Oct 31, 2015 at 04:00 AM
Oct 31, 2015 at 04:00 AM
Hi back,
I have this script
Sub NumberOfActivities()
'
' Rows Macro
' Repeat numbers of rows
'
Dim sh As Worksheet, lr As Long
Set sh = Sheets(1)
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
mult = InputBox("Enter number of activities", "MULTIPLIER")
For i = lr To i Step -1
sh.Cells(5, 1).Resize(1, 9).Copy
sh.Cells(5, 1).Resize(CInt(mult) - 1, 9).Insert Shift:=xlDown
Next
'
End Sub
it can enter number of activities only one time as the second time the number will be minus 1 ,i want to change this, to be able to add more activities without calculating the first one.
Thanks in advance
I have this script
Sub NumberOfActivities()
'
' Rows Macro
' Repeat numbers of rows
'
Dim sh As Worksheet, lr As Long
Set sh = Sheets(1)
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
mult = InputBox("Enter number of activities", "MULTIPLIER")
For i = lr To i Step -1
sh.Cells(5, 1).Resize(1, 9).Copy
sh.Cells(5, 1).Resize(CInt(mult) - 1, 9).Insert Shift:=xlDown
Next
'
End Sub
it can enter number of activities only one time as the second time the number will be minus 1 ,i want to change this, to be able to add more activities without calculating the first one.
Thanks in advance