Hi Gizework,
You aren't very specific. Give this code a try (it's just a start):
Sub RunMe()
Dim sRow As Range
Dim nTimes, fInterval, mLimit, x, y As Integer
Set sRow = Application.InputBox("Select row(s)", Type:=8)
nTimes = InputBox("How many times would you like to insert selected row(s)", "Repeat n times")
fInterval = InputBox("What is the fixed interval?:", "Input fixed interval")
mLimit = InputBox("Input the row you don't want to insert past:?")
Do
y = y + fInterval
For x = nTimes To 1 Step -1
sRow.Copy
Rows(y).Insert
Next x
Loop While y < mLimit
End Sub
Best regards,
Trowa
Could you provide some sample data? How it is now and how you want it to look.
Best regards,
Trowa
First of all I would like to thank you for your help and for giving me your time. Let the text that I want to copy and insert is Text A in first two rows. Then I need this will be copied like below.
A
1 TextA
2 TextA
3
4
5 Text A
6 TextA
7
8
9 Text A
10 TextA
11
12
13 TextA
14 TextA
.
.
.
Let the letter A on the top designate the excel column and the numbers from 1 up to 14 on the left side of the text designate the rows of excel and the gaps (the rows) that have no Text A is I think the fixed interval. The rows that I want to insert n times like above are 1 and 2 together($1:$2).
With best regards
Gizework
I am waiting for your answer. Excuse me since English Language is my second language it may be difficult for me to express my feeling that is why I may not be clear for you. if there is something which is not clear about my question you can tell me I will clarify for that. The reason why I need the solution for the above question is that in our company there is old payroll system that we used for several years. but using this payroll system It took us at least five days to provide payroll sheet and Payroll slip for more than one thousand employees per month that are Entering Individuals' absent days,Over time, Advance and Other Employees' Fields. However now we want to have new payroll system We have almost Developed the system. With this new System We could prepare the payroll sheet within one day so we could minimize four day what we did before. But the problem we faced here is that the payroll slip, to do this we have to export the payroll sheet to excel and inserting the individual Employees' field to each employees that is for one thousand Employees and then we do have Payroll slips which we can provide to our Employees. However what we faced here is we have to Insert the Employees' fields on the first two rows repeatedly on the above of the name and the amount of individual employees, the sample data may be similar with what I provide above that is " Text A".So Please I need your help, if you give me a help on this It will bring a lot change to our company Finance Dep't. I thank you in advance for you help.
with best regards
Gizework