Results 1 to 4 of 4

Run loop based on the value of the cell in a column

Threaded View

chetanojha Run loop based on the value... 07-05-2018, 06:55 AM
AlphaFrog Re: Run loop based on the... 07-05-2018, 07:12 AM
chetanojha Re: Run loop based on the... 07-05-2018, 08:50 AM
AlphaFrog Re: Run loop based on the... 07-05-2018, 08:08 PM
  1. #1
    Registered User
    Join Date
    12-16-2017
    Location
    Reading
    MS-Off Ver
    2010
    Posts
    7

    Run loop based on the value of the cell in a column

    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.
    Last edited by chetanojha; 07-05-2018 at 07:04 AM. Reason: Kept wrong details

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Loop - Colour Range of Cells in Row Based on Cell Value in Column of Same Row
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2017, 04:50 AM
  2. Loop thru column, copy value to different sheet based on value
    By cpyter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2016, 03:21 PM
  3. Replies: 0
    Last Post: 08-11-2016, 09:28 PM
  4. Delete a column based on a heading cell value and loop
    By hassan88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-03-2015, 07:42 AM
  5. Loop thru ALL sheets, resizing one column in each based on certain criteria
    By jerrydiaz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2014, 08:54 AM
  6. Code to loop through a column and change cell value based on list
    By davekippen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2011, 04:27 PM
  7. Copy and Paste Loop based on corresponding value in another column
    By gibby8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2011, 03:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1