Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. Yet another newbie question here.
I am trying to write a macro, starting with A4, copies the text in every 44th row and pastes the text into another worksheet. It should do this for a user defined number of times. The first cell of interest is A4, the next would then be A48, etc... I can't figure out how to construct the loop. I have tried it using Step (is this right?) and also using variables and Offset. I have gotten so confused that I don't know what I am doing at this point! Here is the mess that I have at the moment: Sub test2() Dim StartValue As Integer Dim n As Integer n = CInt(InputBox("Enter the number of inputs: ")) StartValue = 4 For Count = 1 To n Step 44 ActiveCell.Offset(StartValue, 0).Select Selection.Copy Sheets("Sheet2").Activate ActiveCell(Count, 0).Select ActiveSheet.Paste Sheets("Sheet1").Activate Next Count End Sub Any help would be much appreciated! Thanks, H.M. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Loop to Find then Copy & Paste | Excel Discussion (Misc queries) | |||
Loop thru rows to copy to another excel spreadsheet | Excel Worksheet Functions | |||
Data Validation skips rows | Setting up and Configuration of Excel | |||
Hide Rows - copy and paste only rows that show | Excel Worksheet Functions | |||
copy,paste and loop through workbook | Excel Discussion (Misc queries) |