+ Reply to Thread
Results 1 to 11 of 11

Copy range if the cell is not empty

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Copy range if the cell is not empty

    Hi
    I have a range ("B2: E2"), and would like the cell in column A, being respectful of emptiness, this range ("B2: E2"), the cell was copied to your right.

    If A3 <> "" then
    copy ("B2: E2") to the cells ("B3: E3").

    If A4 <> "" then
    copy ("B2: E2") to the cells ("B4: E4").

    And so on.

    Im try this, but dont work
    Please Login or Register  to view this content.

    Can anyone help me?
    Since now I thank you!

    See Attachment
    Attached Files Attached Files
    Last edited by marreco; 03-22-2012 at 10:38 AM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy range if the cell is not empty

    Why not put this formula in B3 and copy across and down as necessary?

    =IF($A3<>"",B$2,"")

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    Hi StephenR

    I already have this feature, but I'd like via VBA.

    Some users use the spreadsheet and the times just messing with formulas and then they do not know right.
    if you can I'll judar muiito grateful for the help.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy range if the cell is not empty

    This will run every time something in column A is changed:
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    one more question.
    as I do, when you enter the value in a cell in column A?
    is giving error.

    Thank you for everything

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy range if the cell is not empty

    What error do you get? It works for me.

  7. #7
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    After typing in cell A3, everything will be fine.

    then try to delete what you typed in A3

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Copy range if the cell is not empty

    Works for me.

  9. #9
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    Yes, im test now nd work!!!

  10. #10
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    StephenR Hello, I need a hint you.

    when I lay various data, A3, A4, A5 etc.

    generates an error.

    You can adapt the code to, paste multiple data at once?

    Thank you!

    Cross-Post
    http://www.thecodecage.com/forumz/mi...post1054995113
    Last edited by marreco; 03-22-2012 at 04:25 PM.

  11. #11
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Copy range if the cell is not empty

    Was solved!!
    Cros-post
    http://www.thecodecage.com/forumz/mi...ious-data.html

    Please Login or Register  to view this content.

+ 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