LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy the row multiple times while translating the columns

Sub Copy3Times()
Dim sh As Worksheet, sh1 As Worksheet
Dim col As Long, cell As Range
Dim rw As Long, rng As Range
Set sh = ActiveSheet
Set sh1 = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
sh.Activate
col = ActiveSheet.Cells(1, "IV").End(xlToLeft).Column
Set rng = Range(Cells(1, 1), Cells(1, 1).End(xlDown))
rw = 1
For Each cell In rng
cell.Resize(1, col).Copy Destination:=sh1.Cells(rw, 3)
cell.Resize(1, col).Copy Destination:=sh1.Cells(rw + 1, 2)
cell.Resize(1, col).Copy Destination:=sh1.Cells(rw + 2, 1)
rw = rw + 3
Next cell
End Sub


--
Regards,
Tom Ogilvy

"Anamik" wrote in message
...
(Sorry for cross posting but I did not get a satisfactory respons ein
excel.mis)

Hi,

I want to copy each row in the file 3 times one after another. The second
copy should be translated one column to the left and the third copy two
columns to the left. For example, suppose I copy the rows
a b c
d e f
They should look like
a b c
a b c
a b c
d e f
d e f
d e f


Tom thank you very much and sorry for getting back after so long. The
function you have given works. The only problem is it keeps on creating new
sheets without stopping. I inserted break point at the beginning and could
stop it manually. So, for me it works.
Thank you very much.
Anamik.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
'move or copy' a single worksheet multiple times DebC Excel Discussion (Misc queries) 10 April 3rd 23 04:26 PM
Is there anything that will copy previous entry multiple times? stacey Excel Discussion (Misc queries) 2 December 18th 08 06:06 PM
Copy line multiple times throughout spreadsheet? MEE Excel Discussion (Misc queries) 3 October 26th 07 07:51 PM
macro to copy a value multiple times depending on value in adj dribler2 Excel Worksheet Functions 0 January 10th 07 12:48 AM
how do i copy the same cell multiple times in excel. Andy Excel Discussion (Misc queries) 1 July 7th 06 12:50 AM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"