Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

macro edit

ResolvedVersion 2007

Sarah has attended:
Excel VBA Intro Intermediate course
Access Advanced course
Access Intermediate course

Macro edit

I've just recorded a new macro that conducts a formula on selection of cells.

How do I go about editing this formula to run the macro on a new selection of cells?

Basically I've got quite a few columns of 51 rows of figures and every other column I need to percentile rank which I'm doing using the PERCENTRANK formula.

This is what my VB code looks like at the moment from just recording the macro.

Sub Prank()
'
' Prank Macro
'
'
ActiveCell.FormulaR1C1 = "=PERCENTRANK(R2C9:R52C9,RC[-1])"
Selection.AutoFill Destination:=Range("J2:J52"), Type:=xlFillDefault
Range("J2:J52").Select

End Sub


As you can see I've run this macro on cells J2 to J52. I will now want to run the same macro on cells K2:K52, then M2:M52, O2:O52, etc, etc, etc.

Help! I don't know where to start.

Thanks,
Sarah

PS. Is there a simple bit of code where I can say 'insert a new column after every other column?' So for example to the right of column D insert a new column, then to the right of column F, etc, etc.

RE: Macro edit

Hi Sarah

Thanks for your comprehensive post regarding your macro and VBA script.

We have had a review and whilst a solution is beyond the scope of this forum we can build a solution for you by having access to your files.

We estiamate it will take about half a day of trainer development to reach a solution. If you would like to discuss how we can progress this along with indication of costs please let me know.

Kind regards

Jacob

Fri 16 Apr 2010: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Toggle Formulas and Results

Ctrl + 'The key above Tab with the

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.