ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with Looping Macros (https://www.excelbanter.com/excel-worksheet-functions/267634-help-looping-macros.html)

Chaitanya

Help with Looping Macros
 
Hi i am currently in the process of trying to transpose my data from one sheet to another within the same workbook.
Here's is the VBA script of the macro:
Sub Transpose()
'
' Transpose Macro
' Macro recorded 12/24/2010 by Chaitanya Rane
'

'
Range("D2:D24").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=True
Sheets("Sheet2").Select
Range("E2:E24").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("Z3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=True
End Sub
__________________________________________________ ______________
What i need this macro to do now is loop and keep pasting the data from sheet two except that the selection range [ Range("D2:D24").Select & Range("E2:E24").Select] has to add 23 to it so that will be [Range("D25:D47").Select&Range("E25:E47").Select] so and so forth till the last value is D&E8396 respectively.

In essence i know what i want the function to do but cant get the syntax.
Also is there any other way than using a macro.
Please help!!


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com