![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Andy Devine
Posts: 106
|
hi i'm a bit of a novice, how do i change below so copies to, say, "sheet2" instead of adding new sheet
thanks Andy Dim v Dim s As Range Dim c As Range Dim t As Range Dim sTitle As Range Dim w As Worksheet Set s = ActiveSheet.Range("i2") Set s = ActiveSheet.Range(s.End(xlToRight), s.End(xlDown)) Set sTitle = ActiveSheet.Range("A1:H1") Set w = Worksheets.Add() Set t = w.Range("A1") sTitle.Range("A1:H1").Copy t.Range("A1:H1").PasteSpecial xlPasteValues For Each c In s Set t = t.Offset(1, 0) c.End(xlToLeft).Range("A1:H1").Copy t.Range("A1:H1").PasteSpecial xlPasteValues t.Offset(0, t.Offset(0, 9) = c.Value Next
__________________
Andy Devine |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
I'm assuming that "Sheet2" is the name of the sheet on the worksheet tab.
Quote:
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
Andy,
Can't help you with this question but you were great at the Printers Devil last Friday. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|