Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Cesar Gonzalez   on Sep 21 In MS Office Category.

  
Question Answered By: Nagaraju Iyaner   on Sep 21

Try:
Sub XportQCReport()

Dim Wk As Workbook
Dim Wk2 As Workbook
Dim n As Integer
Dim y As Integer

Set Wk = ActiveWorkbook 'The orginal workbook  with the case data
Set Wk2 = Workbooks.Add 'The destination workbook

Wk.Activate
Sheets("PDI_DataQC").Select

y = InputBox("How Many Cases (i.e. 1-200)?")

For n = 1 To y
Wk.Activate 'Added by Pascal
Range("B1").Select
ActiveCell.FormulaR1C1 = n

Sheets("PDI_DataQC").Select
Cells.Select
Selection.Copy

Wk2.Activate
ActiveWorkbook.Worksheets.Add.Name = n
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False 'Added by Pascal
Next n
End Sub

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Data from a form on a worksheet in new workbook... Or get search suggestion and latest updates.


Tagged: