dab1477
Board Regular
- Joined
- Jul 30, 2002
- Messages
- 65
Although this project would be done better in ACCESS, I'm stuck doing it in Excel. Thanks for bearing with me.
I have created a form where I select a machine and part number from a drop down menu. Once selected, these values are placed into an Excel spreadsheet and I run an INDEX/MATCH function to pull data from a larger sheet. At this point, all this data resides within a single row on the targeted spreadsheet.
I want to show this data on a form that I created in excel. The idea is to print the form and use the parameters to setup the part number job on the machine again.
I have the following sample code related to trying to return the cell value to the form:
Private Sub button_enter_click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("retrieve")
irow = ws.Cells(Rows.Count, 9)
'enter Machine and Part Number parameters into Retrieve sheet
ws.Range("b6").Value = txt_machine.Value
ws.Range("d6").Value = TXT_PARTNUMBER.Value
Exit Sub
'return data FROM sheet to FORM
txt_lastdate.Text = ws.cells(irow,9).Value
End Sub
I have tried txt_lastdate.value = ws.cells(irow,9).Value.
I have tried txt_lastdate.value = ws.range("a9").Value.
The actual data in cell A9 is the return value of the INDEX/MATCH function. Does this make a difference? If so, how do I get around it?
I get error stating OUT OF MEMORY. I have no other application running, and have only a total of 3 routines totaling 30 lines. This is not a memory error that I can ascertain.
Thanks in advance for all help provided. I'm stumped!
I have created a form where I select a machine and part number from a drop down menu. Once selected, these values are placed into an Excel spreadsheet and I run an INDEX/MATCH function to pull data from a larger sheet. At this point, all this data resides within a single row on the targeted spreadsheet.
I want to show this data on a form that I created in excel. The idea is to print the form and use the parameters to setup the part number job on the machine again.
I have the following sample code related to trying to return the cell value to the form:
Private Sub button_enter_click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("retrieve")
irow = ws.Cells(Rows.Count, 9)
'enter Machine and Part Number parameters into Retrieve sheet
ws.Range("b6").Value = txt_machine.Value
ws.Range("d6").Value = TXT_PARTNUMBER.Value
Exit Sub
'return data FROM sheet to FORM
txt_lastdate.Text = ws.cells(irow,9).Value
End Sub
I have tried txt_lastdate.value = ws.cells(irow,9).Value.
I have tried txt_lastdate.value = ws.range("a9").Value.
The actual data in cell A9 is the return value of the INDEX/MATCH function. Does this make a difference? If so, how do I get around it?
I get error stating OUT OF MEMORY. I have no other application running, and have only a total of 3 routines totaling 30 lines. This is not a memory error that I can ascertain.
Thanks in advance for all help provided. I'm stumped!