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.

Macro to Paste One Cell to Right

Discussion in 'Business Applications' started by COLLINSM45, Dec 24, 2010.

Thread Status:
Not open for further replies.
  1. COLLINSM45

    COLLINSM45 Thread Starter

    Joined:
    Dec 20, 2010
    Messages:
    4
    Operating system: windows vista
    Computer: Dell 1737 studio
    Software: Microsoft Excel 2007
    Concern: I created a chart that have the price in a row that changes daily and want to create a macro that will paste this price
    from another worksheet cell to the right from the last used cell in the chart worksheet.
    Sample:
    SELECT_COPY_PASTE_PRICE Macro:

    Data in worksheet "AEEQUERY" cell "G2" ($35.00)<this price
    I want to paste in worksheet "AEE" .....row C7,
    if C7 is blank, if C7 isn't blank, paste in C8, if C8 is blank, if C8 isn't blank, paste in C9, "..paste one cell to the right from the last used cell in row.

    Any help greatly appreciated.
    '
     
  2. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    Welcome to the board.

    Your description's a bit confusing. The code below is adapted from a thing by Ron de Bruin here. It will copy to the first free cell in row 7. Note that no selecting is involved. Make sure the "source" worksheet is active when you run it.

    Sub LastColumnInOneRow()
    'Find the last used column in a Row: row 7 in this example
    Dim LastCol As Integer
    With Sheets("ADOBE")
    LastCol = .Cells(7, .Columns.Count).End(xlToLeft).Column
    End With

    Range("G2").Copy Sheets("ADOBE").Cells(7, LastCol + 1)
    End Sub
     
  3. COLLINSM45

    COLLINSM45 Thread Starter

    Joined:
    Dec 20, 2010
    Messages:
    4
    To remove some confusion, post was edited.
     
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/970462

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice