Dear Forum Members,
I am new or novice to the VBA coding and need some help. I have a table as shown below.
Column A |
Column B |
Y |
java -jar "London" "Rainy" 30c -a |
Y |
java -jar "NEW YORK" "Dry" 40c -a |
N |
java -jar "SYDNEY" "Sunny" 10c -a |
N |
java -jar "MANCHESTER" "Humid" 10c -a |
Y |
java -jar "AMSTERDAM" "Cloudy" 20c -a |
With the help of people on this and other forums .. I managed to work out how to run the Java command in loop. But at the time of posting the original reqt. I didnt realised whether I can run java command based on the values in Column A? Which means the loop runs through Column A and if it find the flag = 'Y' it will run the java command present in column B.
The code so far is below:
Dim cell As Range, command As String
ChDir ThisWorkbook.Path
MsgBox ("Generating District files")
For Each cell In Range("B2", Cells(Rows.Count, "B").End(xlUp))
Shell cell.Value, vbNormalFocus
Next
MsgBox ("Files Generated")
Can anybody help?
Thanks.
Bookmarks