Results 1 to 3 of 3

Thread: Excell VBA question

  1. #1
    Guest

    Unhappy

    I know this shouldn't be a difficult question, but on a Monday morning, I'm having major difficulties.

    I am writing a macro for a spreadsheet and I can't figure out how to store the ActiveCell range (ie. B1), go do another process (ie. create a column) and go back bo the originally selected cell (ie. B1).

    In theory, I want to do this:

    rOrigCell = ActiveCell.<something>
    Columns(ActiveCell.Column + 1).Select
    Selection.Insert
    ActiveCell.<something> = rOrigCell

    What is the <something> that I am looking for?

    HELP!!!!!

    Thanks!!!

    Dan

  2. #2
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    dim r as range


    set r = activesheet.activecell

    Columns(ActiveCell.Column + 1).Select
    '/
    '/ go off and do your stuff
    '/

    r.Activate '/ will make your original cell/range active.


    td.

    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  3. #3
    Guest
    Thank you VERY much. It didn't like the ActiveSheet.ActiveCell, but I just assigned ActiveCell to r and all is working perfectly.

    Thank you so much!!!

    Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width