Hello all
I have a macro that creates a batch file based on what a user selects from one column of drop down menus. What I need some help with is including some extra information if the user needs to type it in.
Here's a fake example. The user selects Google and let's pretend that Google has the ability to login by using the following link: http://www.google.com?username=NAME&password=PASS. In my spreadsheet, there are spaces for a username and a password directly to the right of the drop down menus. It would be easy to reference them if the rows stayed the same for each option, but a user could put Google in any of the drop down menus in row 2, 4, 6, etc. There are too many options to assign each one a specific row, and I already have everything programmed to simply look for a value in the cells, which would only occur if a user selects from the drop down menu.
I think I need some sort of command that is similar to VLOOKUP, but it can't require the initial column to be alphabetical since the users won't pick their choices based on the alphabet. I need the macro to look for Google Username, then if it finds it, get the value for the cell directly to the right and put it in for the NAME. Then I need it to find Google Password, and do the same thing (put the value from the cell to the right in for PASS).
Thanks everyone!
I have a macro that creates a batch file based on what a user selects from one column of drop down menus. What I need some help with is including some extra information if the user needs to type it in.
Here's a fake example. The user selects Google and let's pretend that Google has the ability to login by using the following link: http://www.google.com?username=NAME&password=PASS. In my spreadsheet, there are spaces for a username and a password directly to the right of the drop down menus. It would be easy to reference them if the rows stayed the same for each option, but a user could put Google in any of the drop down menus in row 2, 4, 6, etc. There are too many options to assign each one a specific row, and I already have everything programmed to simply look for a value in the cells, which would only occur if a user selects from the drop down menu.
I think I need some sort of command that is similar to VLOOKUP, but it can't require the initial column to be alphabetical since the users won't pick their choices based on the alphabet. I need the macro to look for Google Username, then if it finds it, get the value for the cell directly to the right and put it in for the NAME. Then I need it to find Google Password, and do the same thing (put the value from the cell to the right in for PASS).
Code:
If Range("C6").Value = "GOOGLE.com" Or Range("C8").Value = "GOOGLE.com" Or _
Range("C10").Value = "GOOGLE.com" Or Range("C12").Value = "GOOGLE.com" Or _
Range("C14").Value = "GOOGLE.com" Or Range("C16").Value = "GOOGLE.com" Or _
Range("C18").Value = "GOOGLE.com" Or Range("C20").Value = "GOOGLE.com" Or _
Range("C22").Value = "GOOGLE.com" Or Range("C24").Value = "GOOGLE.com" Or _
Range("C26").Value = "GOOGLE.com" Or Range("C28").Value = "GOOGLE.com" Or _
Range("C30").Value = "GOOGLE.com" Or Range("C32").Value = "GOOGLE.com" Or _
Range("C34").Value = "GOOGLE.com" Then
Print #FileNumber, "echo start /d /max http://google.com?username="what goes here?&password="and what goes here?" _
>> " & Chr(34) & "%USERPROFILE%\Start Menu\Programs\Startup\StartUp.bat" & Chr(34) & ""
End If