Cut/Paste Range to dynamically created worksheet

ianquiksilver

New Member
Joined
Nov 2, 2017
Messages
11
Hello all Excel'ers :)

I have a quick question to ask. I'm in the process of writing a While loop which would cut the first 3000 rows and paste them into a newly created worksheet. I know the code to create a new worksheet, but is there a way of automating the "cut first 3000 rows to *new* worksheet" on the fly? Because currently I can only paste a range to another worksheet that I refer to by name (for example) "Sheet2", "Sheet3" but what if I don't know beforehand how many worksheets will be created? .. Is there a way to target "last Worksheet"? Because then I just need to "create new worksheet, after current one" and then run the "cut & paste 3000 rows to Last Worksheet" "while the first worksheet has more than 3k rows".
I'm NOT asking for the full code, just how to target an automatically created worksheet dynamically :)
thanks so much for all your input and help, not to mention your time! :)

best regards!
Kris A

PS: my final aim with this algorithm would simply be to split a huge database into smaller sections via Worksheets, then getting a file saved from each sheet.
 
Here is a example of how Resize can be used.
The script puts "Me" into Range("A1")
Then the script resizes Range("A1") down 40 rows and to the right 10 columns
Code:
Sub Resize_Me()
Range("A1").Value = "Me"
Range("A1").Resize(40, 10).Value = Range("A1").Value
End Sub
 
Last edited:
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top