View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Socko Socko is offline
external usenet poster
 
Posts: 28
Default copy row 2 of any wsheet to the new crated wsheet


Dim samplerow As Range
Set samplerow = ActiveSheet.Rows(2)

'Display message, title, and default value.
Dim Message, Title, Default, MyValue
Message = "Enter a name for the new Worksheet" '
Set prompt.
Title = "Add New sheet Input
Box" 'Set title.
Default = "Give me a
Name" 'Set default.
MyValue = InputBox(Message, Title, Default) '


Set NewSheet = Worksheets.Add
NewSheet.Name = MyValue
'cmbWsheet.AddItem MyValue

NewSheet.Activate
NewSheet.Cells(2, 1).Select

samplerow.Copy
ActiveSheet.Paste

ActiveSheet.Cells(1, 1).Activate

I hope this helps...

Selva V Pasupathy
For more on Excel, VBA, & other Resources
Please visit: http://socko.wordpress.com