Ask Experts Questions for FREE Help !
Ask
    compryan's Avatar
    compryan Posts: 2, Reputation: 1
    New Member
     
    #1

    Feb 26, 2009, 01:40 PM
    Macro help
    Hi all,

    I am currently working with a dataset where the data in column A is empty until a user enters a rank (i.e. like ranking grades in ascending order). Currently the macro takes the number and moves the row entry to the top by assuming that the rank is to be the highest rank (it then takes the other manual ranks and moves them after this rank in ascending order); however, if a user places a lower rank on an already higher score (for instance #30 on #5), it doesn't move down... it moves up. Simply, it's the logic of the macro. However, I need help in modifying this macro to move any manual ranking to the appropriate position and moving other rows to their appropriate position based on these manual ranks.

    For instance, this is what I need it to do:

    A: Original Rank 1 Manual Rank 3 Final Rank D
    B: Original Rank 2 Empty Final Rank B
    C: Original Rank 3 Empty Final Rank A
    D: Original Rank 4 Manual Rank 1 Final Rank C
    E: Original Rank 5 Empty Final Rank E

    Here's the macro thus far:

    j = 1
    Sheets("POR Ranking").Select
    Range("A16").Select
    iRow = ActiveCell.CurrentRegion.Rows.Count + 14
    For I = 1 To iRow
    If ActiveCell.Value <> "" Then
    j = j + 1
    ActiveCell.Offset(1, 0).Select
    Else
    iRow = j + 14
    sRanking = "Manual Listing"
    Go to SetSummary
    End If
    Next I

    Any assistance would be greatly appreciated! Thanks everyone.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Feb 26, 2009, 01:55 PM

    Are you trying to modify the sheet through a VB front end?
    compryan's Avatar
    compryan Posts: 2, Reputation: 1
    New Member
     
    #3

    Feb 26, 2009, 02:24 PM

    The script was created in the Excel VB editor (behind a command button).
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Feb 26, 2009, 03:27 PM

    Then this belongs in the Spreadsheet forum, not VB. VB is a stand alone programming language. What you need is help with Excel VBA. So I moved the thread for you.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

If statement macro [ 10 Answers ]

Hello , I have an excel macro to take data from one spreadsheet and format in a partciular method. Now I want to add an if statement like I have an excel formula that works but I need it put into the macro. The formula is: if(AA21="USD", "6YB", "6YA") Help Thanks

Excel macro [ 4 Answers ]

I need to run a macro that opens excel so I can kick off "application.ontime" basically my macro should run without me having to start excel, just have the computer and outlook running. Is that possible?

Cut and paste a macro? [ 3 Answers ]

I'm trying to create a spreadsheet based on an older version that has a macro. When open both workbooks, cut and paste the old to the new, open vb editor and drag the forms folder and modules folder to the new workbook the macro runs but is broken (it works in the old workbook) Is there more to...

Macro system [ 2 Answers ]

:confused: what do you think is the most significant macro system in today's family life. (church, Social agencies, health care program, etc)


View more questions Search