Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to insert new worksheet based on # of rows in a data sourch
Hello,
I am trying to get the below VBA code to only copy "form" and create new worksheet based on number of rows with data in my "data" sheet. Is there a way that can be done? Sub Copy_Sheets() Dim i As Integer Dim wks As Worksheet For i = 1 To 45 Sheets("form").Copy After:=Sheets(2) Next End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to insert new worksheet based on # of rows in a data sourch
On Wednesday, May 2, 2012 10:09:21 AM UTC-5, Rachel Rios wrote:
Hello, I am trying to get the below VBA code to only copy "form" and create new worksheet based on number of rows with data in my "data" sheet. Is there a way that can be done? Sub Copy_Sheets() Dim i As Integer Dim wks As Worksheet For i = 1 To 45 Sheets("form").Copy After:=Sheets(2) Next End Sub more detail |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to insert new worksheet based on # of rows in a data sourch
Assuming Column A has range of rows to count.
Sub Copy_Sheets() Dim i As Integer Dim rng1 As Integer rng1 = Sheets("Data").Cells(Rows.Count, 1).End(xlUp).Row MsgBox rng1 & " Sheets will be added" For i = rng1 To 1 Step -1 Sheets("form").Copy after:=Sheets(2) ActiveSheet.Name = "form" & i Next End Sub Gord On Wed, 2 May 2012 08:09:21 -0700 (PDT), Rachel Rios wrote: Hello, I am trying to get the below VBA code to only copy "form" and create new worksheet based on number of rows with data in my "data" sheet. Is there a way that can be done? Sub Copy_Sheets() Dim i As Integer Dim wks As Worksheet For i = 1 To 45 Sheets("form").Copy After:=Sheets(2) Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert rows based on value per day | Excel Worksheet Functions | |||
How to insert rows based on change in data | Excel Worksheet Functions | |||
Insert new rows based on Data in other rows | Excel Worksheet Functions | |||
Insert Rows Based on values in another worksheet | Excel Discussion (Misc queries) | |||
Excel Data Sourch Setup for Merge | Setting up and Configuration of Excel |