R
Roger Converse
Hello,
I am going way outside of my comfort zone and am attempting to create a form
in Excel. The original form was posted in another forum, and I liked what
the form did so I thought I could the basics and apply what I wanted. Well,
that is not proving to go so smoothly.
Basically, I am looking for the form to open (when the button is clicked)
with data attached to the combo box, find the value the user either enters or
chooses and then create a table based on the infomation in that record.
I could create this in Access, but I am pretty much the only person in my
company that uses Access. Therefore, I am trying to do this in Excel, which
is what everyone in my office is familiar with.
My beginning questions are:
1.) How do I set the combobox to a specific range of cells?
2.) Even though I don't have the combobox tied to anything, the search
function will still find a match. However when the code goes to (or is
supposed to) find the correct range, it doesn't appear to be happening as I
step through the code. Which is weird, because it is the exact same code
that is used in a different macro.
3.) Once the correct range is selected, how do I translate that into a
table? I am looking into the offset function, because it seems to be used
with a lot of charts, but I really don't know much about it yet.
I thought this would be a little more similar to Access.
Any assistance would be greatly appreciated.
Thank you,
Roger
Here is the sample code. It needs a lot of help.
Dim strFind 'what to find
Dim rSearch As Range 'range to search
Dim lngMonth As Long ' for when January rolls around and the selection
cirteria
Set rSearch = Sheet1.Range("b1", Range("b65536").End(xlUp))
strFind = Me.cboxType.Value 'what to look for
Dim f As Integer
With rSearch
Set c = .Find(strFind, LookIn:=xlValues)
If Not c Is Nothing Then 'found it
c.Select
lngMonth = 0
lngMonth = Format(Date, "MM") - 1
If lngMonth = 1 Then
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Else
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
End If
End If
End sub
I am going way outside of my comfort zone and am attempting to create a form
in Excel. The original form was posted in another forum, and I liked what
the form did so I thought I could the basics and apply what I wanted. Well,
that is not proving to go so smoothly.
Basically, I am looking for the form to open (when the button is clicked)
with data attached to the combo box, find the value the user either enters or
chooses and then create a table based on the infomation in that record.
I could create this in Access, but I am pretty much the only person in my
company that uses Access. Therefore, I am trying to do this in Excel, which
is what everyone in my office is familiar with.
My beginning questions are:
1.) How do I set the combobox to a specific range of cells?
2.) Even though I don't have the combobox tied to anything, the search
function will still find a match. However when the code goes to (or is
supposed to) find the correct range, it doesn't appear to be happening as I
step through the code. Which is weird, because it is the exact same code
that is used in a different macro.
3.) Once the correct range is selected, how do I translate that into a
table? I am looking into the offset function, because it seems to be used
with a lot of charts, but I really don't know much about it yet.
I thought this would be a little more similar to Access.
Any assistance would be greatly appreciated.
Thank you,
Roger
Here is the sample code. It needs a lot of help.
Dim strFind 'what to find
Dim rSearch As Range 'range to search
Dim lngMonth As Long ' for when January rolls around and the selection
cirteria
Set rSearch = Sheet1.Range("b1", Range("b65536").End(xlUp))
strFind = Me.cboxType.Value 'what to look for
Dim f As Integer
With rSearch
Set c = .Find(strFind, LookIn:=xlValues)
If Not c Is Nothing Then 'found it
c.Select
lngMonth = 0
lngMonth = Format(Date, "MM") - 1
If lngMonth = 1 Then
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Else
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
End If
End If
End sub