I am currently using Microsoft Visual Basic 2010 *(VBA)* and Microsoft Excel 2010, to create an interface for a user to select their location then a device they wish to have information for, in return for output of device information (usage, etc.) My question I have been looking for has yet an answer and leaves me looking for the VB code needed to continue. I have an input box, that asks the user to type in their device (which is the a string) and the idea is this:
If chkCapacity.Checked = True Then
lblOutput.Text = "This is the Capacity for " & cmbLocation.SelectedItem & " " & strdevice
lstResults.Items.Add(cmbLocation.SelectedItem)
lstResults.Items.Add("Device_Capacity")
End If
I want to be able to call the matching information that I have in Excel, for the Location, Device, and then the end result they want. There are already Excel columns for location, device and capacity. I hope I made this clear. (Match the device selected and location selected to the excel values, return the device information needed) Obviously I can't just do:
Dim Sheet_Device_Capacity As String
Sheet_Device_Capacity = exSheet.Range("s2:s75").Value.ToString
since I'm trying to match the column of device and location not just the column of capacity.
My spreadsheet looks like this:
PoP Device 1 Capacity
Rochester - Not in Location - 42%
Syracuse - In Location - 33%
Binghamton - In Location - 45%
Albany - Not In Location - 50%
(Hopefully you understand the formatiing as I couldn't add an image)