Hello,
I'm very new to VBA and would greatly appreciate any help on this code...
I have set up a Userform to enter data not only by category, but by date--I have both row and column headings. My userform includes a textbox (TextBox5) that I have coded to show the current date. I would like for my form entries (e.g., Boards, Bags, Boxes, Dowels, etc.) to fall into the column with the matching date heading on my spreadsheet. My userform captures quantities purchased, always integers.
Here is what I have:
Dim iColumn As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
Dim logday as Date
Set logday = TextBox5.Value
iColumn = ws.Range("B1:H1").Find(What:=logday, SearchOrder:=xlColumns, SearchDirection:xlPrevious, LookIn=Values).Column
ws.Cells(2, iColumn).Value=TextBox1.Value
ws.Cells(3, iColumn).Value=TextBox2.Value
...And so on down the row for the other textbox entries.
The debugger tells me "Object required" and highlights the text I have bolded. But I thought that defining as "Date" was an Object type.
Thanks so much for any help!
Bookmarks