+ Reply to Thread
Results 1 to 14 of 14

Macro running but not working

  1. #1
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Macro running but not working

    Need help with my code below. i am trying to build a macro that copies data from sheet2 and pastes into queue performance but nothing is being pasted in?i.e values arnt working
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,017

    Re: Macro running but not working

    Try changing

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.


    Or, instead, change

    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Hi, that code works but it is not putting the data into the correct cells.
    I want the data to start populating from "B4" onwards but it skips to column X.

    The previous columns B4 to W24 do not have any data in them except for some formatting.

    Any ideas

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    Hi,

    It may be that you need to change the row that you use to search for the last column.

    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Hi , No that doesnt work either. i have attached the file i am using , could you see if you could see the problem.

    I want the data from sheet 2 to be pasted into queue performance sheet starting in G4 which is todays day and continue on to the next colume for the next day.

    At the moment the macro seems to think most of the colums are filled and is skipping to colume x.

    As well, the data needs to be entered from the 4th row down however it is beginning in the 1st and is overriding the date heading and then the last few rows have no data
    Attached Files Attached Files
    Last edited by dee2016; 08-05-2016 at 07:18 AM.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    You didn't mention anything about locating today's date. You merely said that you wanted the data pasted to the next column.

    It also seems that you are sending the data to a range starting at row 1 which is not what you want. May I suggest this:

    Please Login or Register  to view this content.
    Last edited by xlnitwit; 08-05-2016 at 07:26 AM.

  7. #7
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Hi man, sorry i thought it wouldn't matter if the date was there but i see where you're coming from now, that solution seems to work well.

    could it be possible for you to add comments around the code so i can understand fully what each statment is doing please

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    Certainly. Please see below.
    Please Login or Register  to view this content.
    Note I made a small change to the code to simplify it in case you should wish to change the output location.

  9. #9
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Thats great thank you,

    If you go into the file I attached earlier, row 10 is actually used to sum up the rows above it, is it possible to incorporate this into the macro because at the moment that row is left blank ?

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    Of course. All you need add is this:
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Works perfectly, what exactly is it doing?

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    It adds a formula to sum from row 4, or whichever row is set as the start of the output, to the row above the formula cell.

  13. #13
    Registered User
    Join Date
    07-21-2016
    Location
    ireland
    MS-Off Ver
    Office 2013
    Posts
    22

    Re: Macro running but not working

    Thank you, I have an issue with the code,
    This part

    Please Login or Register  to view this content.
    the name of the workbook changes every month i.e August changes to September and so on.

    Would it be possible to make the macro work on the active workbook it is open in at that time?
    Otherwise the detail in the macro code will have to be changed every month

    Thank you

  14. #14
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro running but not working

    If the macro is in the workbook to which you want to refer, use ThisWorkbook.

    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)

Similar Threads

  1. Macro not working properly when called from Button (Running otherwise)
    By AnimeshRoy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2016, 10:39 AM
  2. Keyboard keys are not working after running macro
    By excelliot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-24-2014, 12:05 PM
  3. Macro not working while running multiple others macro..
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2014, 11:27 AM
  4. Macro to hide/unhide cells not running or running slow
    By mbp727 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2013, 04:22 PM
  5. Need some help on keeping UNDO/REDO working after running macro's. Almost there ;-)
    By onidarbe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 02:00 PM
  6. [SOLVED] Allow users to edit ranges not working after running a Macro?!
    By Margate in forum Excel General
    Replies: 2
    Last Post: 02-15-2013, 07:42 AM
  7. running macro on time not working
    By SJDANIELS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2008, 10:33 AM

Tags for this Thread

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