View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Create a sheet and name it

Hi JeanLuc,

Assign the new sheet to an object variable, e.g.:

'=============
Sub Tester()
Dim WB As Workbook
Dim srcSH As Worksheet
Dim destSH As Worksheet

Set srcSH = ActiveSheet
Set destSH = WB.Sheets.Add(After:=Sheets(WB.Sheets.Count))

'Your copy code, e.g.:
srcSH.Range("A1").Copy Destination:=destSH.Range("C1")
End Sub
'<<=============

---
Regards,
Norman



wrote in message
oups.com...
I need to write a macro which does the following

1) Create a new sheet in the current workbook

2) Scan the current sheet split each row into several columns and write
them in new sheet.

I know how to scan the current sheet but my problem is how, from the
current sheet, referer to the sheet I need to use to add rows. It is
not a copy row by row as sometimes several rows will make one row on
the new sheet