+ Reply to Thread
Results 1 to 14 of 14

Copy sent to "History Sheet" everytime the Active X button is pressed.

  1. #1
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Copy sent to "History Sheet" everytime the Active X button is pressed.

    Hello,

    I am looking for cells B18, C18, and E18 on Sheet 1 to be sent to the History sheet to the first available open row when the Box Count button is pressed. The first available row starts at row 3 and moves down depending on how many entries are already on the page. Any help would be appreciated. I'm not very good with this part of vba coding.


    Thanks


    The code is in module 1 as Sub Boxcount. Here is the code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Is anybody awake this morning that is good with this sort of thing? I tried to figure out how it was being posted to the history sheet by my other command buttons, but I had no luck.

  3. #3
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Okay, I made one change to the range I was sending to the history sheet. I just unmerged a cell, so the range is now B:18 to D:18.

    I wrote a code that is doing what I asked, but it doesn't work like the other code that was written for me. This code flashes to the "History Sheet" and then back to "Sheet 1". That does not with the original coding in the Inventory active x button.

    If anyone can modify this code so it is more efficient without the quick flash to copy and paste the information to the "History Sheet", I would be interested in learning.

    Thank you for any help in advance.

    Final Code for now

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    This is way to easy. See the highlighed fonts added to the code.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Please Login or Register  to view this content.
    I have been working on another way to send it to the "History Sheet" similar to the way it was sent with the other Active x buttons but it keeps giving me an error and tripping out the please select a row message.

    When I am selected in any of the three boxes it will send the copy to the history sheet, but when I am selected somewhere else on the sheet it will not send a copy to the history sheet.

    Either way the new code keeps stopping on the bolded area.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    That's because the code requires the active cell to be one of the cells that contain the dropdown box in column A.

    So, yes, if the active cell is other than that, the code 'fails' and shows the message box to select a size or to select a row (depending on the button pressed).

  7. #7
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    What do I need to do to that line to get it to specify that I am working with the range B:18 to C:18? Wrote all of the If Statements, but some of the other coding I had help with. I am just beginning to get a grasp on it from the reading and research I have been doing. It has helped out a lot to be able to work with this a piece at a time.

    The more you can tell me about what is wrong with it the better it is for me to learn this.


    P.S. The Application Update worked fine. It was definitely annoying to see it flip back and fourth. Thank you.
    Last edited by Spreadlover; 11-16-2013 at 11:21 AM.

  8. #8
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    I believe your problem lies with the highlighted section of the code below. The line 'With.ActiveCell' needs to be changed.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Please Login or Register  to view this content.
    This is the code I have come up with for now. It does work, but it will work from anywhere the selected cell is. I cannot find a working error code to let me know the selected cell is not one of the three cell B18, C18, or D18....
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    There are two different codes here for copy and pasting to another sheet. Neither one are quite right yet, so I am looking for the copy and paste experts.

    With the first one,
    Please Login or Register  to view this content.
    this part of the code needs to paste special and just transfer the values. Right now it is still carrying the original format and I would like it to just transfer the values.

    With the second one, I still haven't found a way for the code to make sure it is selected on the group of cells copying to the History Sheet.

  11. #11
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Add the highlighted part to the end of your code;
    I believe this will do what you need.
    Please Login or Register  to view this content.

    If that doesn't do everything you need, then try this;


    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    I couldn't get either one of those codes to work this morning. I will investigate it more after work today.

  13. #13
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Please Login or Register  to view this content.
    This is the code I am using to copy my entry to the History Sheet in my workbook from sheet1. I am looking to find a way to identify the active cell or cells in range R1 to copy to the History Sheet or have a message box come up and say "please select row." It is likely I will add another small range underneath it (as shown on sheet1 in my example) so I will need to distinguish between the two.

    Thanks for any help.

  14. #14
    Forum Contributor
    Join Date
    06-28-2013
    Location
    Green Bay, WI
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Copy sent to "History Sheet" everytime the Active X button is pressed.

    Quote Originally Posted by Spreadlover View Post
    This is the final coding I came up with. Now I will be able to add other items to track on sheet1 as long as they are in the B, C, and D columns. Only the row selected will be active and I did not have to name a specific cell for the subtraction or the copying to the History Sheet.

    Thanks for the help!!

    Please Login or Register  to view this content.
    If you look in module 3, you will see this code and a whole other way to copy and paste to the another sheet.
    A few things were change around since I started this thread, but this is the final code I came up with.
    Attached Files Attached Files

+ 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. How to copy "command button" to another sheet
    By norika in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2015, 01:47 PM
  2. [SOLVED] Copy range from hidden sheet to active sheet if cell ="Some text"
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2013, 01:19 AM
  3. Button that makes the "Find and Replace" popup come up when pressed.
    By fred80213 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-12-2013, 01:54 PM
  4. [SOLVED] Macro to look up and down from the active cell, copying the active "section" of the sheet
    By mikkola in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2013, 07:21 PM
  5. Locked sheet, Button to remove or "copy add" specified columns
    By ballex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2012, 08:58 AM

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