+ Reply to Thread
Results 1 to 8 of 8

Finding a cells location and then adding a value

  1. #1
    Registered User
    Join Date
    06-03-2007
    Location
    Wilmington, NC
    MS-Off Ver
    2007
    Posts
    26

    Finding a cells location and then adding a value

    I have a workbook that on Sheet 2 I have 3 boxes - 1. Name 2. Amount 3. Date - I would like to select from the drop down menu the name and the date and put in the amount of cash they paid. From there I would like for the amount to be placed in that cell on page 4 that corrasponds with that date and name. Is there a way to do that?
    Attached Files Attached Files

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    re: Finding a cells location and then adding a value

    See if this does what you are wanting. On your date row I had to change those from a formula to an actual date so the search would work properly. I also made it so it would clear your fields on Sheet2 after the data has been moved.
    Attached Files Attached Files
    Sincerely,
    Jeff

  3. #3
    Registered User
    Join Date
    06-03-2007
    Location
    Wilmington, NC
    MS-Off Ver
    2007
    Posts
    26

    re: Finding a cells location and then adding a value

    Well now it has to run the debuger becuase there is a problem with the scripit. Not sure how to fix it - can you?

  4. #4
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    re: Finding a cells location and then adding a value

    When it goes into debugger what is the message that it gives you and what line of code is high lighted.

  5. #5
    Registered User
    Join Date
    06-03-2007
    Location
    Wilmington, NC
    MS-Off Ver
    2007
    Posts
    26

    re: Finding a cells location and then adding a value

    Never mind I figured that part out - now what if a new memeber comes into the group and I have to add a new person - is there a way I can click an option to add a new memeber at the bottom of box 1 on sheet 1? Will it also do all the functions on page 2 like it already is?

  6. #6
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Re: Finding a cells location and then adding a value

    There are some folks who do everything out on the sheet and there are others who do things behind the sheet back in VBA. I am one of those who use VBA and do very little on the sheet. In light of that here is a revision.

    Lets forget about the entry sheet. I have added a button in cell A2 which will bring up the User Form you had already created. The only thing I have changed on the form is I changed the date textbox to a combobox and added a new button. The form will remain loaded until you press on Exit. After you press Record Payment it will record the payment, then it will clear the name and amount, but will leave the date. This will allow you to enter several payments for the same date.

    The code used to load the name combobox will pick up any new names you add to your spreadsheet. I used a combobox for the date to be sure you could only select a date you actually have on the sheet.

    Give this a try and let me know how it works for you.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-03-2007
    Location
    Wilmington, NC
    MS-Off Ver
    2007
    Posts
    26

    Re: Finding a cells location and then adding a value

    When I go to put in a new name it comes up as a debug
    wsSht4.Cells(lRow, lCol).Value = cAmt
    am I doing something wrong?

  8. #8
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Re: Finding a cells location and then adding a value

    Are you entering the new name directly on the sheet or are you trying to enter it on the userform? You need to enter it on the sheet. The userform will pick up the list of names from what you have listed on the sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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