+ Reply to Thread
Results 1 to 43 of 43

[Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Exclamation [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    Hi Guys,

    I have a Master sheet(Excel Sheet) which contains the columns Resource name, No: of Hours, File names and Mail id. In this sheet, i have two types of employees. ie., Permanent and temporary. we can identify the employee type based on their file names.(time sheet names). for example, permanent employee's file name will have a format such as "TS-KKCMania-hyd-" and temporary employee's file name will have a format such as "KKCMania". All the time sheet's of temporary employees are available in the master sheet itself. but, i need to fetch the permanent employees's time sheet's from other location.

    The problem here is, i need to display all the time sheet's of both the temporary and permanent employye's in the same order as they were displayed in the master sheet(as like the order in Resource Name column) followed by the Consolidate Sheet.

    The Sample Data in the below link will give you a more clear picture.
    Attached Files Attached Files
    Last edited by kkcmania; 04-24-2013 at 03:15 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    Its better you attach the sample excel file here instead of having us download it from an external site.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    Yeah Sure Arlu.. I have attached my master sheet for you.

  4. #4
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    Here are the Time sheet files related to Permanent employees.
    Last edited by kkcmania; 04-23-2013 at 07:55 AM.

  5. #5
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    The Remaining two Time sheet files related to permanent Employees are as follows. please find the attachments.
    Attached Files Attached Files
    Last edited by kkcmania; 04-23-2013 at 07:56 AM.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    I hope there is no confidential data in your files.

  7. #7
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    I Got u. i forgotten to change something in my files. if u don't mind, i will do it and upload the files agian. seriously, i didnt observed it in the first instance. Thank you...
    Last edited by kkcmania; 04-23-2013 at 07:51 AM.

  8. #8
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Inserting Time sheet Data in to Master sheet Based On the Condition Using Macros.

    Quote Originally Posted by arlu1201 View Post
    I hope there is no confidential data in your files.
    Thank you arlu.. I have uploaded the files with necessary changes. please find the attachments.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    So you need the data to be filled in from the individual files into the master sheet? Or do you want the individual files to be copied and pasted as individual sheets in the master?

  10. #10
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    So you need the data to be filled in from the individual files into the master sheet? Or do you want the individual files to be copied and pasted as individual sheets in the master?

    Sorry for the late reply. i have just seen your reply.

    Yes, I Want the Individual files to be copied and pasted as individual sheets in to the master (along with its Actual sheet name).

  11. #11
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Can any one solve this please...

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Working on this. Sorry, couldnt do it earlier.
    Last edited by arlu1201; 05-02-2013 at 05:29 AM.

  13. #13
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    Working on this. Sorry, couldnt do it earlier.
    hey, Sorry Arlu. yeah, I thought so. i know u have a lot of threads to be taken care of. Anyway, thank you for getting in to mine.

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    All the files for the permanent employees will be stored in one folder right? Will there be files for the temporary employees in the same folder?

  15. #15
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Yes arlu, in case if any one of the files (temporary files) were missing in the master sheet. they need to copied from the same folder where the permanent files exists.

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    You have given the file names for the permanent employees in column D, where would the temporary employees' info be listed?

  17. #17
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    You have given the file names for the permanent employees in column D, where would the temporary employees' info be listed?
    In the same column D itself. as i said in my first post, permanent employee's file name will have a format such as "TS-KKCMania-hyd-" and temporary employee's file name will have a format such as "KKCMania". if the timesheet related to the temporary file is already available in the Master sheet, its ok. otherwise, we have to copy that particular temporary employee's timesheet from the folder.

  18. #18
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Hi Arlu, Did i cleared ur question? If not, Please inform me.

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Ok i will work something out for you.

  20. #20
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Thank you Arlu. Thanx a lot for your time and Patience.

  21. #21
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Try this code - extremely sorry for the delay -
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  22. #22
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Hi Arlu,

    Thank you for the code. I appreciate your Concern. I tried the code and its doing exactly like i wanted. but, its showing run time error '1004' at the end. i have attached the error that its showing. in my final result the time sheet with file name "TS-Vinodini-hyd-" is missing. please specify the reason.
    Attached Images Attached Images

  23. #23
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Your file path shows Kishore\/Desktop. Check the file path properly in the code.

  24. #24
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    Your file path shows Kishore\/Desktop. Check the file path properly in the code.
    Hi Arlu,

    My File path is C:\Users\KishoreV\Desktop\Test Master Folder\Permanant Employees. Its not Kishore\/Desktop as you specified. please check my attachment once.

  25. #25
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    I am sorry, the V looked like \ and /. The macro picks up the file based on the name in column D. Is it blank for that row?

  26. #26
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Yeah, I thought so. The name for that file is not blank in column D. the name is available in there. but, still i am getting the error.

  27. #27
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    And which line is highlighted in the code when the error occurs?

    Whats the exact text of the error?

  28. #28
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    the attached one is the error that i am getting.

    Please Login or Register  to view this content.
    this is the line that is highlighted when the error is raised.
    Attached Images Attached Images

  29. #29
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Check that the filename in the excel sheet and the filename of the file in the folder match properly, spelling, case, etc. The error states that the file couldnt be found.

  30. #30
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    Check that the filename in the excel sheet and the filename of the file in the folder match properly, spelling, case, etc. The error states that the file couldnt be found.
    I Have checked the filename in the Excel sheet and the filename of the file in folder as you specified. everything's looking fine and its still raising an error.

  31. #31
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Is it always the last entry in the column that is giving you the error?

  32. #32
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Yes arlu.. Thats right.

  33. #33
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    So the file is present in the folder but the macro is not picking it up to be added to your file right?

    Let me check again.

  34. #34
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Yes arlu, That's what happening.

  35. #35
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    I got the error when Vinodini was not found in the folder. So since the file was not present, it gave an error.

    How do you want to handle this?

  36. #36
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    like u said, It will raise error when "Vinodini" file is not present in the folder. but, in this case "Vinodini" file is present in the folder. so, it shouldn't raise the error. but, still its raising an error.

  37. #37
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Let me duplicate one of my files and name it as Vinodini and try, since i dont have the Vinodini file.

  38. #38
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Ok, i found out the issue. You have the column with filenames which can have entries either as KrishnaMohan or TS-Karanvijay-hyd-. However the sheets dont have the TS against them. So we can sort this out in 2 ways - either have another column giving the list of sheet names or name the sheets as per the entries in the Filenames column (C). How do you want to handle this?

  39. #39
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    The later one is better for me, i guess. i.e., naming the sheets as per the entries in the Filenames column. Thank you for finding the issue.

  40. #40
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    But since you are copying the file as a whole from the other files to your main file, the sheet name will need to be changed in those source files.

  41. #41
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Quote Originally Posted by arlu1201 View Post
    But since you are copying the file as a whole from the other files to your main file, the sheet name will need to be changed in those source files.
    Oh, I am afraid that is not possible in our case. May be its better to create an another column which contains the list of sheet names.

  42. #42
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Your updated code is here
    Please Login or Register  to view this content.
    There was a space after the text in cell D15 in the Consolidate tab, hence the error. Put the sheet names in column F and then run the code.

  43. #43
    Registered User
    Join Date
    04-10-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Thumbs up Re: [Urgent] Inserting Time sheet Data in to Master sheet Based On the Condition Using Mac

    Thank you Arlu...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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