Made that change, still same error.
wsNew(Month(rsLeave![Start Date])).cells(rownum, rsLeave![Start Date] + i).BackColor = vbGreen
thats the line that is highlighted.
I am getting "Object doesn't support this property or method"
rownum = 1
While Not rsLeave.EOF
rownum = rownum + 1
For i = 0 To DateDiff("d", rsLeave![Start Date], rsLeave![End Date])
wsNew(Month(rsLeave![Start Date])).cells(rownum, rsLeave![Start Date] +...
so I have NO CLUE how to do the things y'all have stated. So far in my coding I have done easy stuff. Looping would probably be the best but how do I set up the parameters so when it goes down the list in the RS that it puts the leave in the right place?
this is what the spreadsheet looks like.
Like say someone has leave from the 5th - 10th. I want to grab that ID # and shade in those days on the spreadsheet. How do I find that specific column on the right months sheet?
Last piece I need to finish this document. I need a way to pull the data from my rsLeave and put it into the spreadsheet. It needs to have the start date and end date of the leave as well as the space between all shaded and merged.
Dim xlApp As Object
Dim xlWB As Object
Dim...
yeah they are trying to incorporate the newly created database with an old used system to track leave. Command wants a 1 stop shop instead of having to input the leave data into 2 different locations. It is causing me a headache.
so far I have:
Dim xlApp As Object
Dim xlWB As Object
Dim wsNew As Object
Dim rsRoster As DAO.Recordset
Dim rsLeave As DAO.Recordset
Dim dbCurr As DAO.Database
Dim strRoster As String
Dim strLeave As String
Dim x As Long
' 'Set variables
Set...
awesome that worked and I added a few other things but do I have to add in a seperate if statement for each month to add in the month at the top??
Select Case wsNew.Name
Case "January", "March", "May", "July", "August", "October", "December"...
fixed that I didn't have xlWB infront of the first worksheets.add.
I am now trying to add in the days and am getting mismatch error.
If wsNew.Name = ("January" Or "March" Or "May" Or "July" Or "August" Or "October" Or "December") Then
wsNew.Range("D2:E2").Autofill...
I am getting an "Object Required" error on the set wsNew line
Dim xlApp As Object
Dim xlWB As Object
Dim wsNew As Object
Dim x As Long
' 'Set variables
Set xlApp = CreateObject("Excel.Application")
Set xlWB = xlApp.Workbooks.Add
xlApp.Visible = True...
yeah my question has morphed a few times since it started. Mind changing and trying to get all the info needed.
Currently I have a table that includes every soldiers leave submission with start dates and end dates.
Currently I have an excel document that I create with the above code, it is a...
oh ok yeah I can make the button just create an excel document for the current month, awesome. I could just make each of those lines into functions and just call the current month in the code. That would also make leap years easier as i can add that into the february function. ok so thinking...
I have a multiselect list box in my form and I have a button that prints what is selected to PDF. I want a message box to pop up that states to ensure the selected number is not already open in pdf view.
MsgBox "Please ensure that CNF " & me.lstBox.Value & " is not already open."
doesn't...
I want to change this from being 1 fiscal year a sheet to just having an excel document per fiscal year with each month a different sheet. How do i go about creating the 12 sheets with VBA?
I have a button that creates an Excel document. I want it make it flow better and to adjust for leap year. It has to flow October through September and have the FY as the name of the tab your on.
My current code is just 1 sheet and very long, there has to be a way to make it more streamline...
so thats how to manually change it. I was looking for a VBA option to add it to my code for the search.
Jdraw, that is a continuous form, what I am trying to do is create a report from a form input.
After reading a bunch of google and the responses here looks like if i want to have the searched text highlighted my best bet is to open the report in Word. What would that look like? Could I keep the code i have or do i have to rewrite everything?