I have a massive amount of feedback data from a simulation machine that needs to be reorganized. In order to do this efficiently, I need a macro that will select every 24th cell within a column from a relative reference point. This task would need to be done on an infinite loop. I have tried the "record macro" functions in Excel 2007 have been unsuccessful. The macro I tried was...
However, this macro didn't actually activate every 24th cell (I'm not entirely sure what it did if it did anything). If someone could provide me with the code for a macro that would accomplish the aforementioned tasks I would really appreciate it.Code:Do Until ActiveCell.Value = "" ActiveCell.Offset(1, 0).Range("A1,A25").Select ActiveCell.Offset(25, 0).Range("A1").Activate Loop End Sub
Thanks.
Last edited by Othelloguy; 07-04-2009 at 10:51 PM.
Welcome to the forum.
Please take a few minutes to read the forum rules, and then edit your post to add code tags.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Try the following.
Possible reasons why it might not work:Code:Dim rng As Range: Set rng = ActiveCell Dim rngUnion As Range: Set rngUnion = ActiveCell Set rng = rng.Offset(24, 0) Do While Len(rng.Value) > 0 Set rngUnion = Union(rngUnion, rng) Set rng = rng.Offset(24, 0) Loop rngUnion.Select
(1) I don't know how many components a multiple range is allowed to have, so perhaps the table could be too large for it to be possible to select every 24th cell?
(2) If your data extends right to the bottom of the sheet then presumably "rng.Offset(24, 0)" will cause an error at some point.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks