Methinks you are making this much more difficult than necessary. Either fully explain what you want with before/after example If all else fails, send file to dguillett1 @gmail.com
On Tuesday, October 2, 2012 4:33:57 PM UTC-5, Diamond Dave wrote: > > Attached is a file which contains a Macro (Shift Data). > > There is a variable number of data sets (all the same configuration) > defined in Cell A1 with the formula A1=Counta(B:B)-2 which defines the > actual number of data sets. > > > > The macro (below) defines what needs to be done to the first and Second > data set > > > > 'Data Set 1 > > > > Range("E4").Select > > Range(Selection, Selection.End(xlToRight)).Select > > Range(Selection, Selection.End(xlDown)).Select > > Selection.Cut > > ActiveCell.Offset(0, -1).Select > > ActiveSheet.Paste > > ActiveCell.Offset(3, 0).Select > > Selection.EntireRow.Insert > > ActiveCell.FormulaR1C1 = "variance" > > ActiveCell.Offset(4, 1).Select > > > > 'Data Set 2 > > > > Range(Selection, Selection.End(xlToRight)).Select > > Range(Selection, Selection.End(xlDown)).Select > > Selection.Cut > > ActiveCell.Offset(0, -1).Select > > ActiveSheet.Paste > > ActiveCell.Offset(3, 0).Select > > Selection.EntireRow.Insert > > ActiveCell.FormulaR1C1 = "variance" > > ActiveCell.Offset(4, 1).Select > > > > How would I write a loop which will perform the function for “Data SET 2” > the number of times shown in cell A1? > > > > Your Support is greatly appreciated > > David Pehrson > -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com.