Search results

  1. V

    Solved Data from another form pop up

    Ok this is a weird one stay with me. I have a data entry form that captures all the data for everybody. This is saved to a table called Roster. Each section has their own macro button to open a form with their specific peoples data. There are 2 variables that designate when a person leaves...
  2. V

    Function in a loop

    Yeah but the functions were giving me the specific cell based on 3 different unknowns. The spreadsheet was a home made colander of sorts, row 1 had the months by name "January", "February", and so on as merged cells since row 2 had the number day of the month "1", "2", and so on. So I had to...
  3. V

    Function in a loop

    YES!!!!! awesome thank you soo much it works just like I want it to.
  4. V

    Function in a loop

    If I change htat then would the range line be: With xlSh.range(BeginDate, FinDate)
  5. V

    Function in a loop

    the highlighted line after i hit debug is: With xlSh.range(startRange, endRange)
  6. V

    Function in a loop

    the functions are this over and over for every day of the year: Private Function BeginDate(rsLeave As Date, rownum) As String If Month(rsLeave) = "1" Then If Day(rsLeave) = "1" Then startRange = "CR" & rownum ElseIf Day(rsLeave) = "2" Then startRange = "CS" & rownum
  7. V

    Function in a loop

    The thing holding me back from doing what you posted in 10 is that I get a compile error "Expected: end of statement" highlighting rsLeave. Edit: I changed it slightly to read startRange = BeginDate(rsLeave![Start Date], rownum) to get around the compile error. I did the stop and found out...
  8. V

    Function in a loop

    ok I thought I had to initialize the variable before the functions. Each of the functions uses the respective variable to create the specific cell. Let me clear up what the functions do cuz they are TOO long to put in code. They take the date and go through a series of IF statements, IF...
  9. V

    Function in a loop

    Yeah there are 2 ways to define a range I have seen: "A2:G20" or "A2", "G20" if I use the colon method I get a syntax error, it is looking for the quotes. the comma method doesn't give me a syntax error but I still get the application defined error.
  10. V

    Function in a loop

    Oh nevermind about that error I see what my problem was for that, it was a typo. Once I fixed that I get "Application-defined or object-defined error" now highlighting: With xlSh.range(startRange, endRange) could it be that the variables are strings and range wont take a string variable?
  11. V

    Function in a loop

    oh so change the function from recordset to date. I can see the logic in that now thanks. Now I get a Compile error ByRef argument type mismatch. If you haven't noticed I am very new to using functions.
  12. V

    Function in a loop

    I need it to return a date because in the function it removes the month and the day respectively to get the accurate column in the spreadsheet.
  13. V

    Function in a loop

    So I have 2 functions that return a specific cell location in Excel. One for a start date and the other for the end date. Once I have these 2 dates I will create a range with them to fill it with a color. My current loop looks like this: Do While rsLeave.EOF = False Set rRange =...
  14. V

    Display List items in TextBox

    Yup you were right result = result & .ItemData(varItem) instead of result = result & .ItemsSelected(varItem) Thank you
  15. V

    Display List items in TextBox

    adding .Column to the end of varItem displays an error: "Compile Error: Variable required - can't assign to this expression" That highlights the .Column aspect of the code What do you mean ItemData?
  16. V

    Display List items in TextBox

    I am trying to display multiselected list items into a text box. Dim result as String Dim varItem as Variant With Me.lstType If .ItemSelected.Count <> 0 Then For Each varItem In .ItemSelected result = result & .ItemsSelected(varItem) & vbNewLine Next End If...
  17. V

    Is there a better way?

    the first line in that with block is commented, it was just me trying to test out between function. I do not want to shade in the WHOLE Mrng just the cells that coincide with rsLeave![start Date] and i as well as in between. the Mrng variable is to get the column range of the month of...
  18. V

    Is there a better way?

    yes that part is fixed and working. Thank you, There are 2 things left that I am working on my month range in the variable Mrng and highlighting the cells for start date, start date+i, and everything in between. After doing A LOT of different things testing and trying I am still stuck, here is...
  19. V

    Is there a better way?

    So, am I doing something wrong with trying to set the Mrng variable? Doing this will make the columns find the appropriate value.
  20. V

    Is there a better way?

    adding any of the optional values I get an error "Subscript out of range"
Back
Top Bottom