Hi All,


Need your help on below scenario

I have no. of values in one column...for ex. (1000)
input box is given to decide the no. of worksheets. for ex. (50)

Now I want to create first workbook for given no. of sheet (as per user input = 50)
then create next workbook for next 50 values in column
then next workbook...

upto end of values in column (1000)

so Total no. of workbooks would be 20 (1000/50)
and total numbers of worksheets in each workbook will be 20.

NOTE: below code is working fine for adding no. of sheets as per userinput, but getting hard to implement to workbook loop functionality

can some one help please...

Sub abc()
Dim checktotalvalue
Dim strvalue As Integer

strvalue = InputBox(Prompt:="How many ODS you want in one file.", Title:="ENTER NUMBER OF ODS", Default:=20)
If strvalue < 1 Then
           Exit Sub

Else
Dim countflag As Double

    ThisWorkbook.Sheets("object").Activate
    SaveODSDetails


    For a = 9 To (9 + strvalue) - 1
        If Not ThisWorkbook.Sheets("object").Cells(a, 1) = "" And ThisWorkbook.Sheets("object").Cells(a, 4).Value = "X" Then
            b = ThisWorkbook.Sheets("object").Cells(a, 1)
            ThisWorkbook.Sheets("ODS Detail").Copy Before:=ActiveWorkbook.Sheets(1)
            ActiveSheet.Name = b
                Range("B2").Select
                Range("B2").Value = b
            Call filldata
        End If
    Next a

    ActiveWorkbook.Close True
    countflag = Application.WorksheetFunction.CountIf((ThisWorkbook.Sheets("object").Range("D9:D1048576")), "X")
    MsgBox "New Workbook created for Objects"

End If
End Sub