+ Reply to Thread
Results 1 to 2 of 2

Populating detailed level of data based on the different database

Hybrid View

  1. #1
    Registered User
    Join Date
    03-18-2019
    Location
    bangalore
    MS-Off Ver
    10
    Posts
    1

    Populating detailed level of data based on the different database

    Hi All,

    I am very new to VBA trying to solve a automation problem,
    I have 2 datasets (A & B), A is the main database used for analysis and the B is the reference for the gaps.

    A dataset has a column containing salaries (but no detailing to it)
    B dataset has salary seperated by their experience level. Like '0-2 yrs', '2-5' etc.,

    I need to apply some logic and compare the A dataset salary with B and derive at the experience level salaries for A.


    A
    Profile Median Salary
    AC Mechanic 15000
    Accounts executive 24000
    IT recruiter 20000


    b
    AC Mechanic 0-2 13000
    2-5 18000
    5-8 21000
    Accounts executive 0-2 15000
    2-5 19000
    5-8 22000

    I have 3 levels to cross to check for this (sector, profile and city)

    1. First it has to match the sector then profile then city and then the salary (tolerance level could be 20-30%)

    Sub expauto()


    tlastrow = Sheets("Teamlease").Cells(Rows.Count, "A").End(xlUp).Row
    nlastrow = Sheets("Naukri").Cells(Rows.Count, "A").End(xlUp).Row

    For i = 2 To tlastrow
    For j = 2 To nlastrow
    If Sheets("Teamlease").Range("A" & i) = Sheets("Naukri").Range("A" & j) Then
    For k = 2 To tlastrow
    For l = 2 To nlastrow
    If Sheets("Teamlease").Range("B" & k) = Sheets("Naukri").Range("B" & l) Then
    For m = 2 To tlastrow
    For n = 2 To nlastrow
    If Sheets("Teamlease").Range("C" & m) = Sheets("Naukri").Range("C" & n) Then
    For o = 2 To tlastrow
    For p = 2 To nlastrow
    If Sheets("Teamlease").Range("D" & o) <= 0.2 * Sheets("Naukri").Range("F" & p) Then
    Sheets("Teamlease").Range("E" & o) = Sheets("Naukri").Range("D" & p)
    End If
    Next p
    Next o
    End If
    Next n
    Next m
    End If
    Next l
    Next k
    End If
    Next j
    Next i


    End Sub


    Please verify this code and help me out with where I went wrong.

    Or someone could code for the requirement, it would be grateful.

    Thanks

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Populating detailed level of data based on the different database

    Hi, welcome to the forum.
    May I point out that you should read the rules about how to post code within code tags and more such things.
    What do you need verified?
    Have you not been able to check it yourself? You can go though the code line by line and see it as it goes

    Sample file will make it easier (dummy / non-sensitive data please) to help (with the macro code included
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

+ 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. [SOLVED] Populating a master database based on separate worksheets
    By bkdre in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-17-2018, 06:33 PM
  2. [SOLVED] Arranging a detailed invoice listing in a database format
    By josephteh in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-16-2017, 05:53 AM
  3. access database convert to detailed list
    By SSJAMES18 in forum Access Tables & Databases
    Replies: 1
    Last Post: 02-22-2016, 08:04 PM
  4. [SOLVED] Detailed set of formulas based on imput from one sheet 1 and data from another
    By mikerules in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-18-2014, 12:37 PM
  5. Tool to query xlsx files to create data sets at summary or detailed level using sql.
    By xlbiznes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2013, 03:22 AM
  6. Replies: 1
    Last Post: 01-10-2010, 06:35 AM
  7. Generating a detailed list based on data selected and it's information
    By Shananaaah in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-03-2009, 06:52 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