Hi,
I need to run a report for my school. I need to do a For loop where I need to search Number of activities in the page and move it to right or left depending on the user choice by one cell .
Any help on how to code it.
Have attached a sample.
Hi,
I need to run a report for my school. I need to do a For loop where I need to search Number of activities in the page and move it to right or left depending on the user choice by one cell .
Any help on how to code it.
Have attached a sample.
KittyKat, your workbook does not explain anything!, why dont you try turning on the macro recorder, perform your actions, and then see what code has been generated....you may well be able to manipulate most of the code yourself, when you have something on the way to what you want we will all probably have a better idea of what you are trying to achieve!
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
This makes the first sheet look like your second sheet
I hope that's what you were looking for
By the way, "Activiities" is mis-spelt (since this was school related, I couldn't resist)
[VBA]
Sub ShiftCells()
Dim rData As Range, rCell As Range
Application.ScreenUpdating = False
Set rData = ActiveSheet.UsedRange
For Each rCell In rData.Columns(1).Cells
If Left(rCell.Value, 3) = "No." Then rCell.Insert (xlShiftToRight)
Next
End Sub
[/VBA]