+ Reply to Thread
Results 1 to 27 of 27

Send data from A to B by command only each row

  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Send data from A to B by command only each row

    Hello your Excellency

    I hope this is simple enough. I need to be able to click a cell and it can send data from a specific area to another area.

    I have attached a simple sheet.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    Is it all rows from B to K to copy ?
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Yes, B5 to K5 and all the rows that follow B6 to K6 etc
    Thanks

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Send data from A to B by command only each row

    Put the below in the worksheet module and activate it by double clicking a cell in column M.

    Note the code covers only rows 5 to 55 but can easily be amended to cover more / less rows.
    Please Login or Register  to view this content.
    BSB

  5. #5
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Sorry BSB, this is totally beyond me, looks like some VBA stuff. I only grasp the basic Excel. I was hoping its alot easier than this. I don't even know where to start with your codes Best leave this, thanks anyway.

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    If cells 'color is not an issue, why not to use a formula.
    O6 =IF(B6="","",B6)
    Then copy and paste to column X and down as needed

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Send data from A to B by command only each row

    Quote Originally Posted by HelpHelpHelp View Post
    Sorry BSB, this is totally beyond me, looks like some VBA stuff...
    You posted the question in the VBA section of the forum. I assumed you were expecting that as a solution.

    Quote Originally Posted by HelpHelpHelp View Post
    I was hoping its alot easier than this. I don't even know where to start with your codes Best leave this, thanks anyway.
    VBA is not the dark art many perceive it as. Follow the simple steps below:
    1) Copy the code from post #4
    2) Open your workbook
    4) Right click on the Sheet1 tab and select 'View Code'
    5) Paste the code you copied in step 1 into the code window that opens up
    6) Close the code window
    7) Enter some details in column A:K
    8) Double click on the relevant row number in column M
    9) Watch the data miraculously appear in columns O:X
    10) Sit back and wonder why you've not learned to do this before and consider what other repetitive tasks you perform in Excel that could be automate

    If none of that appeals to you then you can either go with the copy and paste approach suggested by PCI or you can use the attached where I've done all the 'difficult' work for you.

    BSB
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    thanks PCI, but I do need that SEND command because I only want data send when double clicked. The post below by BSB did the trick for me. Thank you for your advice and help anyway, I really appreciate that.

  9. #9
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Hi BSB, that was just absolutely magical. You have solved a major problem for me. I cannot thank you enough. SO THANK YOU, THANK YOU........n!

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Send data from A to B by command only each row

    Very happy I could help

    BSB

  11. #11
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    HI BSB
    I have another question still relating to this issue. I understand the M5:M55 part that I can adjust. The target area in which I want the data to copy to is somewhere else, perhaps another sheet. I don't know how to change that. Copy to same sheet is fine if easier. I think its the target offset part I need to amend but its not as simple as the M5:M55 bit. Please help again, thanks.

  12. #12
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    the data to copy to is somewhere else
    Where is it ? How do you want to speficy it ?

  13. #13
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Quote Originally Posted by PCI View Post
    Where is it ? How do you want to speficy it ?
    Hi PCI
    If you look at the code from post #4 from BSM and relate this to his attachment, you will see the data in B5:K5 are sent to destination O5:X10. To adjust destination, I think (don't forget I know knowing about VBA) I need to change the Range and Target offset. I have tried a few times and it looked stange. If I want to send data to say, destination cell AA5:AJ5, what do I adjust?

    Thanks

  14. #14
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Send data from A to B by command only each row

    To update like that you need to adjust the column element of the OFFSETs.
    .Offset(Rows, Columns)

    Please Login or Register  to view this content.
    BSB

  15. #15
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    OK clear
    Change statement
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    The reference is column M
    -11 stands for 11 columns on the left from M it means B
    -2 stands for 2 columns on the left from M it means K
    So is collected data from B to K in the row where you clicked twice

    11 stands for 11 columns on the right from M it means X
    2 stands for 2 columns on the right from M it means O
    So data collected previously is pasted from O to X in the same row

    To get AA and AJ from destination use 14 and 23

  16. #16
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Send data from A to B by command only each row

    To explain a little more, Target is the cell you double click in. You want to specify how many cells to offset from that and copy the data to.

    So Target.Offset(0,10) will offset zero rows and ten columns from the target.
    Target.Offset(5,20) will offset five rows down and 10 columns to the right.

    So in your case you need to adjust the two red numbers to whatever number of columns you want the copied data to appear in FROM the target.

    BSB

  17. #17
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Thanks again BSB

  18. #18
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Thanks PCI, now am getting the hang of this, I love the detail, now I can do more, thanks a million

  19. #19
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    To help you here a remake of BadlySpelledBuoy' code
    Adjust DestCol to your need: Destination column
    Please Login or Register  to view this content.
    Last edited by PCI; 10-07-2018 at 04:52 PM.

  20. #20
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    HI PCI, I've Just tried it, its MAGIC. I can't thank the two of you enough

  21. #21
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    Good news ... team work result!
    Enjoy EXCEL

  22. #22
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Sorry guys, am hitting problem. I've saved the work in Excel micro enabled template (also saved in micro enabled workbook). When I open the book again the send function doesn't work, the code is still in there. What am I doing wrong

  23. #23
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    Can you access the code (Code must be in the sheet's code) and go step by step into the code using key F8.

  24. #24
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Hi PCI, sorry for the slow reply, I work long hours.
    I view the code via right clicking the sheet page and then view code, the VBA screen pops up. I placed your code in and close the screen. Everything works great. I then save this in Macro-enabled and it still works fine. I close the workbook then open it again, thats when it doesn't work. Ive tried numerous times and have check that the code is still there, same thing happens with the code from BSB. I use Excel 2007 version. I don't understand your F8 key but have tried with curser in different parts, nothing happens. I hope you know what the problem is, thank you again.

  25. #25
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    Is the issue occures with the file attached ?
    If not, there is something wrong with your file: Others macros ...
    If Yes, there is something wrong with your computer
    This file is working very nicely on my computer
    Attached Files Attached Files

  26. #26
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Send data from A to B by command only each row

    Hi PCI
    Just download your file, yes, nothing works so something wrong my end. I will try this on another PC and hope. Thanks a million, have a nice day

  27. #27
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Send data from A to B by command only each row

    Good luck
    Hope you will find

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Macro - Visual Basic - Send command to serial port - Receive Data.
    By reiiling in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2017, 09:37 AM
  2. VBA button to send command to serial port to get data and send to Excel
    By reiiling in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2017, 07:13 AM
  3. Command button to send data to another workbook
    By alfgrey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2014, 03:28 AM
  4. Send cell data to next available blank row on another WB via Command button
    By alfgrey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2014, 08:46 AM
  5. [SOLVED] Command button to transfer multiple data to other sheets, saving in PDF, send email
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-29-2013, 02:03 PM
  6. Send Command
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-22-2013, 04:14 PM
  7. Send data from input to relevant worksheet using command button?
    By Si902 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2011, 03:55 PM

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