Consulting

Results 1 to 7 of 7

Thread: Fetch Data automatically in a single cell

  1. #1

    Fetch Data automatically in a single cell

    hello forum members.
    i have truck running data in km book sheet and outward book sheet as attached. i created a pivot table with sorted data in sheet8. next to pivot table i want to fetch data of column 1 in km book sheet after filtering and sorting data based on vehicle number and km the vehicle ran. i did one myself manually but its too complex to do. i also recorded macro for reference what to filter. after filtering i just entered data in cell i wanted to. but i want a vba code for this. how will i be able to know where my trucks operated between the two kilometeres in pivot data table. PLease help...
    Attached Files Attached Files

  2. #2

  3. #3

  4. #4

  5. #5
    a

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    Quote Originally Posted by krishna2221 View Post
    a
    What's that about?

    The code to unlock the vba code for the above file does not seem to be unlockvba!
    I'm not a member of the forum where you have stated this password and so cannot download the file from there.

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    OK, I got the password to work. See attached where there's a Macro4.
    It's very basic. It will go wrong; there's a fair bit of hard-coding and many assumptions made, but since "now please help me.....the matters a little urgent... " it should get you started.
    Clicking the button on Sheet8 will run it.
    It doesn't delete the prior results, only overwrites them , so if the previous pivot table used more rows than the newer one, the extra rows of results won't be deleted.
    I've added code to the pivotTableUpdate event handler to run the macro, so you don't have to click the button every time the pivot changes.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •