Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Excel 97 Macro

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Could someone tell me why that when I try to copy the value of a cell from one sheet to another, the macro runs fine, but nothing gets copied? The source range contains a formula, but I just want the values copied over.

    Another problem I have: , for example, I'm trying to copy the range A1:C1 on sheet1 to D4:F4 on sheet2 and it says that the cells aren't the same size. Does the column width have to be the same size? I'm coping from a range of 3 cells to another range of 3 cells but I don't get it.

    [ This Message was edited by: boydr on 2002-04-28 18:07 ]

  2. #2
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Regarding the first part of your post, the best thing you could do is post your code so we can see what is happening, and then make recommendations. I suspect that all you should have to do is to select the upper left cell of the destination range, instead of the entire destination range, and that might clear up that issue, unless I'm not understanding your problem.

    Regarding the second half of your post, try this approach:

    Sub CopyIt()
    Sheet2.Range("D4:F4").Value = Sheet1.Range("A1:C1").Value
    End Sub

    Any help?

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    England
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If you have merged cells that can cause a problem.

    Cheers,
    Alan.

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I do have merged cells on both the source and destination. Why would that present a problem?

  5. #5
    New Member
    Join Date
    Apr 2002
    Location
    England
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I think it is because when a cell is merged Excel can't figure out which of the merged cells you want to paste to, but if the merged cells are in the same sequence instead of pasting to the whole range ie D4:F4 just paste to D4 and it should work.
    for example if A1 and B1 are merged and D4 and E4 are merged then copying A1:C1 and pasting to just D4 will work correctly. If however the merged cells do not line up then the merged cells on the destination sheet will be changed to match the originating sheet.

    Cheers,
    Alan.

  6. #6
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks. I'll give it a shot in a day or two. I'm so busy I can't think straight right now.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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