VBA download url in column 2 if "yes" in column 9

JohnDouglas

Board Regular
Joined
Jan 5, 2005
Messages
239
hi guys

i've got a macro that will download every url in column 2. but now i only want it to download the url if theres a "yes" in column 9.

here's the start of my code:
Code:
'----------------------------------

'Start downloads
    Dim i As Long, url As String, sh As Worksheet, QName
    With Sheets("Main")
        For i = 7 To .Cells(65536, 1).End(xlUp).Row

strFrmFullUrl = .Cells(i, 2).Value

any ideas how to insert a check that will see if "yes" is in column 9 of each row with a url?

thanks

john
 
ah yes, <hangs head in shame> that was left over from me previously trying to sort out problems with incrementing - or with what i thought was incrementing problems.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
John

It's pretty hard to follow the flow/logic of your code because of the lack of indentation and your nested Withs.

Where should the code go if there isn't a yes in column I?
 
Upvote 0
i think it should go to after the sheet is named.

i did try, but couldn't if statement to work. but like you say the codes a mess. maybe i should work on the structure a bit and trim it a little. then post back?

Code:
'-------------------------------------------------------------
            
'************ code should go to here i think

'intCnt = intCnt + 1
        Next
    End With
 
Upvote 0
John

That would help I think.:)

I gave it a try myself but soon got lost.:eek:
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top