+ Reply to Thread
Results 1 to 4 of 4

How do I do this (I am new to Excel)

  1. #1
    ashnook
    Guest

    How do I do this (I am new to Excel)

    HI, I am new to excel and this group so treat me kindly :-)

    I want to add some VB code to transfer the cell location on one sheet to
    another.

    That is on sheet1 in cell A1 via VB code I want to insert in that cell
    "=sheet2!c3" so that A1 is always the value of sheet2!c2.

    I am using a ListBox to get a value of a list and put it in 'Reff'.

    The list in sheet 'Constants' is range A3 to A10, so a 3 in Reff points to
    Constants!A5.

    In 'Selection.Cells(1).Offset(0, 1)' I want to end up with "=Constants!A5".
    How do I get there from here?

    Thanks for any help you can give me.

    Also can you reccomend a good book (no, not Harry Potter....)

    ---------------code snip --------------------

    Range("Reff") = lstSelection.ListIndex
    Selection.Cells(1) = lstSelection.Text 'this works fine
    Selection.Cells(1).Offset(0, 1) = 'what do I put here???
    ---------------------end snip

    --
    brian



  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Macro Recorder

    That looks like a great job for the macro recorder
    Select the cell one cell above the point you want to start the macro
    Hit the macro recorder and just do exacactly what you described, when you are finished doing the actions select the cell where you want it to be when the macro finishes.

  3. #3
    Peter Aitken
    Guest

    Re: How do I do this (I am new to Excel)

    "ashnook" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Also can you reccomend a good book (no, not Harry Potter....)
    >


    For Excel programming I immodestly recommend my own book Excel Programming
    Weekend Crash Course. For a more general reference I don;t think you can
    beat the Excel Bible.


    --
    Peter Aitken

    Remove the crap from my email address before using.



  4. #4
    ashnook
    Guest

    Re: How do I do this (I am new to Excel)

    "Peter Aitken" <[email protected]> wrote in message
    news:[email protected]...
    > "ashnook" <[email protected]> wrote in message
    > news:[email protected]...
    >>
    >> Also can you reccomend a good book (no, not Harry Potter....)
    >>

    >
    > For Excel programming I immodestly recommend my own book Excel Programming
    > Weekend Crash Course. For a more general reference I don;t think you can
    > beat the Excel Bible.
    >
    >
    > --
    > Peter Aitken
    >
    > Remove the crap from my email address before using.
    >

    Thanks Peter, I will look into it, in the mean time how do I do what I want
    to do?

    Cheers, Brian



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1