1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel: Uses contents of Cell to select a cell

Discussion in 'Business Applications' started by northco, May 8, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. northco

    northco Thread Starter

    Joined:
    May 8, 2012
    Messages:
    4
    Using Excel 2003 in Windows XP

    I would like to use the contents of one cell as the destination location for copying data.
    For example
    I have 2 worksheets 1) Results and 2) info
    in info
    A1 = 'ABC'
    C1 = 'Results!O54' < this is calculated based on other data in sheet.

    Using a macro, I'd like to copy contents of A1 to cell location 'Results!O54' more specifically to where ever C1 points... C1 will change based on other data in info sheet.

    The macro record for action looks like this (but I would like the 'O54' to be based on contents of C1 which changes)
    Range("A1").Select
    Selection.Copy
    Sheets("Results").Select
    Range("O54").Select
    ActiveSheet.Paste
    Sheets("info").Select

    There is more to it then that but I think this is where I am stumped.
     
  2. Garf13LD

    Garf13LD

    Joined:
    Apr 17, 2012
    Messages:
    455
    Sheets("info").Range("A1").Copy Destination:=Sheets("Results").Range(Sheets("info").Range("C1").Value)
     
  3. northco

    northco Thread Starter

    Joined:
    May 8, 2012
    Messages:
    4
    Thanks!

    That was enough allow me to do what I needed!

    I did have an issue with
    Destination:=Sheets("Results").Range(Sheets("info").Range("C1").Value)
    * compile error Expected: Expression * pointing to the ':='

    But I was able to work around it.

    Again, thanks for direction.
     
  4. Garf13LD

    Garf13LD

    Joined:
    Apr 17, 2012
    Messages:
    455
    There should be a space between := and Sheets(, as in ":= Sheet".
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1052441