Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Okay so the title is stupid, but I don't know how to explain in just a few words my issue. We have a range of dates in Column A Jan 1973 Feb 1973 .... Apr 2009 I am trying to pull numbers from a website that correspond to totals for each month, but the website ( http://tonto.eia.doe.gov/dnav/ng/hist/n9132cn2m.htm) only lists the years, and then each line below it corresponds to a total for each month in that year. Here is an example of the source for year 1973: <tr <td class='B4' 1973</td <td class='B3'60</td <td class='B3'384</td <td class='B3'1,167</td <td class='B3'931</td <td class='B3'1,670</td <td class='B3'1,598</td <td class='B3'1,758</td <td class='B3'1,829</td <td class='B3'1,022</td <td class='B3'1,465</td <td class='B3'1,483</td <td class='B3'1,456</td </tr I used the following code to test getting the January total for each year, but how can I set my loop to skip down 12 cells to the next year? Currently it is putting the January value in each cell for each year Set rng = Range("A2").CurrentRegion Set rng = rng.Resize(rng.Rows.Count, 1) For Each c In rng sURLdate = Format(c.Value2, "yyyy") c.Offset(0, 1).Value = RegexMid(myStr, sURLdate, "class=b3") |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If a date range contains a leap year (date) | Excel Worksheet Functions | |||
Date - I would like to skip weekends in a date range | Excel Worksheet Functions | |||
Locate month n year from range of date | New Users to Excel | |||
Query on Date range does not qualify the Year | Excel Programming | |||
Excel VBA macro - need to edit code to skip a year | Excel Programming |