Phelony
03-10-2009, 03:24 AM
Hi
I'm pretty new to VBA although I've got (or so I thought) the majority of Excel mastered. I'm trying to build an intelligent form that basically does all the thinking for the user. :thumb
As part of this, I've built in sections that take names and then put them into a list, the list then gets counted and the result appears in a seperate cell.
From this cell with the result in is, say (C2), I need to build a macro that will then loop and copy a specific section of a sheet that number of times. :cool:
What I have so far is:
Do
Dim ibtRowCount
ActiveCell.Range("A1:N5").Select
Selection.Copy
ActiveCell.Offset(6, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
Loop
End Sub
This however copies the selection an infinate number of times! :motz2:
I've tried working on the "Dim introwcount as integer" etc that's available from Microsoft Office's own forums, but don't seem to be able to get it to work properly. :bug:
Could someone possibly suggest how I can tell the code to: find out what is in C2, then loop the copy and paste code that number of times.
I've been on this for hours now and I'm triving myself insane :banghead: .
Any help or guidance would be very much appreciated.
Many thanks
Phelony
I'm pretty new to VBA although I've got (or so I thought) the majority of Excel mastered. I'm trying to build an intelligent form that basically does all the thinking for the user. :thumb
As part of this, I've built in sections that take names and then put them into a list, the list then gets counted and the result appears in a seperate cell.
From this cell with the result in is, say (C2), I need to build a macro that will then loop and copy a specific section of a sheet that number of times. :cool:
What I have so far is:
Do
Dim ibtRowCount
ActiveCell.Range("A1:N5").Select
Selection.Copy
ActiveCell.Offset(6, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
Loop
End Sub
This however copies the selection an infinate number of times! :motz2:
I've tried working on the "Dim introwcount as integer" etc that's available from Microsoft Office's own forums, but don't seem to be able to get it to work properly. :bug:
Could someone possibly suggest how I can tell the code to: find out what is in C2, then loop the copy and paste code that number of times.
I've been on this for hours now and I'm triving myself insane :banghead: .
Any help or guidance would be very much appreciated.
Many thanks
Phelony