+ Reply to Thread
Results 1 to 22 of 22

How to update Last names to be the same in Sheet1 using Pivot table to detect typos

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Question How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    I have this pivot table.
    Row Labels Count of Last Name
    Teddy Bear 1
    TeddyBear 1
    CandyCrush 1
    Can dy Crush 1
    King Bob 1
    kingBOB 1

    I wanna create a macro whereby it will
    Update the Names to be the same automatically
    Eg.
    I want Teddy Bear(2nd row) to be the same as the (3rd row) [TeddyBear = TeddyBear]

    How can I achieve this
    Last edited by fluffyvampirekitten; 07-20-2015 at 03:51 AM.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: can you help me convert this to vba :(

    You cannot do that directly on a Pivot Table.

    A Pivot only Displays what is there in the underlying data. So you will have to change the underlying Data 1st.

    Secondly how do we know which of the 2 is right? Teddy Bear or TeddyBear?

    So, what I'd do is, on the underlying data, add a helper column and use the Substitute Function to get rid of all the spaces, which would make both Teddy Bear & TeddyBear to TeddyBear Which I can display on the Pivot Table..
    Cheers!
    Deep Dave

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: can you help me convert this to vba :(

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  4. #4
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: can you help me convert this to vba :(

    Quote Originally Posted by NeedForExcel View Post
    You cannot do that directly on a Pivot Table.

    A Pivot only Displays what is there in the underlying data. So you will have to change the underlying Data 1st.

    So i have to go to the main worksheet ( Sheet1) to make changes?

    Secondly how do we know which of the 2 is right? Teddy Bear or TeddyBear?
    It can take either one.

    So, what I'd do is, on the underlying data, add a helper column and use the Substitute Function to get rid of all the spaces, which would make both Teddy Bear & TeddyBear to TeddyBear Which I can display on the Pivot Table..
    What is a helper column?

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: can you help me convert this to vba :(

    I am afraid you will have to reply to Kyle before I give any further clarification..

  6. #6
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: can you help me convert this to vba :(

    Quote Originally Posted by Kyle123 View Post
    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Okay noted! Sorry , i missed out the rules .

    http://www.mrexcel.com/forum/excel-q...lications.html

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,153

    Re: can you help me convert this to vba :(

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  8. #8
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: can you help me convert this to vba :(

    Thanks for the tip!
    I will absolutely abide by the "cross post" rule in future.

    http://www.mrexcel.com/forum/excel-q...lications.html

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,153

    Re: How to convert this logic to vba

    fluffyvampirekitten, new title ain't any better than old one.

    Your post title should accurately and concisely describe your problem.
    "Convert this logic" say nothing about your problem.

  10. #10
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to convert this logic to vba

    Quote Originally Posted by zbor View Post
    fluffyvampirekitten, new title ain't any better than old one.

    Your post title should accurately and concisely describe your problem.
    "Convert this logic" say nothing about your problem.
    How about now?

  11. #11
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,153

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    see, you can do it
    It would be best to put proper title next time right away so everyone can be more focused on your solution than title.

  12. #12
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    A helper Column is a column which you create for Temporary Calculations..

    Insert a Column between Row Labels & Count of Last Name

    Assuming B2 is the cell where you 1st formula will come, try this - =SUBSTITUTE(A2," ","")

    Use this new column in the Pivot Table..

  13. #13
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by zbor View Post
    see, you can do it
    It would be best to put proper title next time right away so everyone can be more focused on your solution than title.
    Okay ! Noted.
    Thanks for the help !
    So sorry about those errors>.< Was really desperate to find out the answer.

  14. #14
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by NeedForExcel View Post
    A helper Column is a column which you create for Temporary Calculations..

    Insert a Column between Row Labels & Count of Last Name

    Assuming B2 is the cell where you 1st formula will come, try this - =SUBSTITUTE(A2," ","")

    Use this new column in the Pivot Table..


    I can't insert a new column in the Pivot table(between the Row Labels & Count of Last Names)
    I go this error :
    'We can't make this change for the selected cells because it will affect a PivotTable. Use the field list to change the report .If you are trying to insert or delete cells , move the PivotTable and try again . '

  15. #15
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by NeedForExcel View Post
    A helper Column is a column which you create for Temporary Calculations..

    Insert a Column between Row Labels & Count of Last Name

    Assuming B2 is the cell where you 1st formula will come, try this - =SUBSTITUTE(A2," ","")

    Use this new column in the Pivot Table..

    I tried to create a new column in Column A and adjust the formula to be =SUBSTITUTE(B2," ","")

    Is it Possible to replace the values in "Row Labels column" cos i couldn't see any effect Count of Last Name Column? ( After updating the names , the count of last names should change to 2)

  16. #16
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Hi,

    I suggested to add a helper column on the underlying data.

    Can you attach a sample workbook? Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  17. #17
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Question Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by NeedForExcel View Post
    Hi,

    I suggested to add a helper column on the underlying data.

    Can you attach a sample workbook? Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Please see the sample data

    SimpatTest.xlsx

    Before:
    Pivot Worksheet
    Capture1.JPG
    Main Worksheet
    Capture1a.JPG

    After:
    Pivot Worksheet
    Capture2.JPG
    Main Worksheet
    Capture2a.JPG


    is it possible if i only change the names that are shown in the pivot table ?
    I dont want remove all the spaces for all the data , only those that shown in pivot table or the count of last name value is 1.
    Last edited by fluffyvampirekitten; 07-21-2015 at 09:56 PM.

  18. #18
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Hi,

    See the attached file..
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by NeedForExcel View Post
    Hi,

    See the attached file..
    yeah looks great!
    but is it possible if i only change the names that are shown in the pivot table ?
    i dont want to change all?

  20. #20
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Pivot Table will show all the Names you have in your source data by default.. Unless of course you manually filter them out..

  21. #21
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Quote Originally Posted by NeedForExcel View Post
    Pivot Table will show all the Names you have in your source data by default.. Unless of course you manually filter them out..
    Oh my. I wanna use macro for that.
    Oh well , Thank you so much for the help ^^
    Greatly appreciated . Thanks :D

  22. #22
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: How to update Last names to be the same in Sheet1 using Pivot table to detect typos

    Glad to have helped!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 1
    Last Post: 12-15-2014, 08:46 PM
  2. Convert Cell Formula to Convert Text to VBA Code
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2014, 05:51 PM
  3. Replies: 22
    Last Post: 09-15-2013, 10:43 AM
  4. Convert Text Dates, Perform Calculation, Convert back to Text
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2012, 05:25 PM
  5. what function to convert convert 34234 to 99999
    By archiles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2008, 11:26 PM
  6. Replies: 1
    Last Post: 05-10-2005, 07:06 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