Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'move or copy' a single worksheet multiple times | Excel Discussion (Misc queries) | |||
Is there anything that will copy previous entry multiple times? | Excel Discussion (Misc queries) | |||
Copy line multiple times throughout spreadsheet? | Excel Discussion (Misc queries) | |||
macro to copy a value multiple times depending on value in adj | Excel Worksheet Functions | |||
how do i copy the same cell multiple times in excel. | Excel Discussion (Misc queries) |