+ Reply to Thread
Results 1 to 17 of 17

Need assistance on Macro

  1. #1
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Post Need assistance on Macro

    Hey there,

    Attached is the sample file which has two sheets. Sheet 1 contains Raw data and Sheet 2 contains auditor names with the count. I need to allocate the data to particular auditors in such a way that whatever count we enter beside the auditor name that many times should copy and paste into the "auditor" column in sheet 1.
    For instance, If I enter the number '5' for Pawan then Pawan should copy 5 times in the auditor's place and others accordingly.

    Also, need one more button where I can filter the "assignement_week". For example, there will be many week numbers in that column. However, if I enter as 32 then it should delete all other week's data and should show week 32 data only.

    Please review and assist me with this.
    Waiting for your response.

    Thanks in advance.Sample file.xlsx

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Need assistance on Macro

    it should delete all other week's data
    Do mean "hide" rather than delete ?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Need assistance on Macro

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 12-24-2022 at 07:23 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Need assistance on Macro

    Slightly different approach for Requirement 1
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Hi John,
    Thanks for looking into the query. I guess there is some error showing for me..After running the macro by entering the count the first row (auditor name) was getting deleted from sheet 1. Can you please review and advise? However filter macro was working fine.
    Thank You

  6. #6
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Hey Sintek,
    Yes, the above-mentioned code was working fine.
    Thanks a lot for your help.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Need assistance on Macro

    @Sintek: much smarter than me (as usual!!!)

  8. #8
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Hi,
    There is one modification that should be done for the same query. While running the code the starting cell data was getting deleted. So can you please review and fix it for the same?

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Need assistance on Macro

    ... which starter cell ?: no cells are deleted in "Auditor" and cells in column A from row 2 are cleared in "Raw Data"

    Please Login or Register  to view this content.
    Sintek's solution much better

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Need assistance on Macro

    Quote Originally Posted by JohnTopley View Post
    @Sintek: much smarter than me (as usual!!!)
    Not at all John...Just more time reviewing other members' code options...My signature really says it all...

  11. #11
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Hey Jhon,
    This code was working cool now.
    I guess because in the previous code it was mentioned as lr = .Cells(Rows.Count, "A").End(xlUp).Row which is why cleared the row. However, the updated code was working fine now.

    Thank you so much for looking into it again.

  12. #12
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Resolved the thread as the query has been resolved. Once again thanks a lot to both of you for resolving the query on such short notice. This really helped me a lot.

  13. #13
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Need assistance on Macro

    Or write once.
    Please Login or Register  to view this content.
    Kind regards, Harry.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: Need assistance on Macro

    @Pawan: thank you for the rep and your feedback.

  15. #15
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Welcome, John. I really appreciate the support you guys are giving which helping a lot of people out there. 😊

  16. #16
    Registered User
    Join Date
    09-04-2022
    Location
    India
    MS-Off Ver
    Office 16
    Posts
    32

    Re: Need assistance on Macro

    Hey HSV,
    The issue was resolved. However, the above-mentioned code deletes the starting cell data (Auditor) in the "Raw data" sheet. thanks a lot for looking up the query.

  17. #17
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Need assistance on Macro

    True, when only cell A1 is filled.
    Small adjustment but.
    Please Login or Register  to view this content.
    Alternative to write at once.
    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. Need Macro assistance
    By Lawyerboy82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-23-2017, 04:49 PM
  2. Assistance wth a MACRO
    By nick_w in forum Excel General
    Replies: 0
    Last Post: 02-29-2012, 11:42 AM
  3. Macro assistance
    By JeremyWalton81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2011, 01:05 AM
  4. [SOLVED] Macro assistance please
    By DannyStyle22 in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2011, 12:47 PM
  5. Macro assistance please
    By Walter Cohen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2006, 09:55 AM
  6. [SOLVED] Macro assistance please - again!
    By in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2006, 07:40 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