![]() |
Help with my procedure
Below is my procedure which I want it to 1) download the weather from the
web, 2) copy the information onto column a:d, and 3) format the row (from column a and d) if certain conditions are met in column c. My questions a 1) It will not run at the scheduled time. For example, it will not run when it is 7:30 am, 8:30 am, not at all. It was running before. Did I disable something? 2) I am trying to highlight the selection if there is rain or showers? For example, highlight the row 3 (from column a:d) since cell c3 show rain. It is not working. a b c d 1 Date Time Condition Temperature 2 01/05/07 1:30 Clear 70 3 01/05/07 2:30 Rain 80 3) I put the computer to sleep everyday at 3:30 when I go home, and activate the computer everyday at 7:00 am. What I like is to have this procedure to run daily automatically after I activate the computer, without actions on my part such as opening the workbook. Would leaving the workbook open work? -- Sub sfweather() Dim ws As Worksheet Set ws = Worksheets("weather") Nameofthisprocedure = "sfweather" Application.OnTime earliesttime:=TimeValue("7:05 am"), procedu="sfweather", Latesttime:=("7:10 am") Application.OnTime earliesttime:=TimeValue("7:30 am"), procedu="sfweather", Latesttime:=("7:35 am") Application.OnTime earliesttime:=TimeValue("8:30 am"), procedu="sfweather", Latesttime:=("8:35 am") Application.OnTime earliesttime:=TimeValue("9:30 am"), procedu="sfweather", Latesttime:=("9:35 am") Application.OnTime earliesttime:=TimeValue("10:30 am"), procedu="sfweather", Latesttime:=("10:35 am") Application.OnTime earliesttime:=TimeValue("11:30 am"), procedu="sfweather", Latesttime:=("11:35 am") Application.OnTime earliesttime:=TimeValue("12:30 pm"), procedu="sfweather", Latesttime:=("12:35 pm") Application.OnTime earliesttime:=TimeValue("1:30 pm"), procedu="sfweather", Latesttime:=("1:35 pm") Application.OnTime earliesttime:=TimeValue("2:30 pm"), procedu="sfweather", Latesttime:=("2:35 pm") Application.OnTime earliesttime:=TimeValue("3:30 pm"), procedu="sfweather", Latesttime:=("3:35 pm") ws.Range("f3").QueryTable.Refresh BackgroundQuery:=False nextrow = ws.Range("a65536").End(xlUp).Row + 1 ws.Cells(nextrow, 1).Formula = "=today()" ws.Cells(3, 8).Copy ws.Cells(nextrow, 2) ws.Cells(nextrow, 2).Value = ws.Cells(nextrow, 2).Value ws.Cells(3, 7).Copy ws.Cells(nextrow, 3) ws.Cells(nextrow, 3).Value = ws.Cells(nextrow, 3).Value ws.Cells(3, 6).Copy ws.Cells(nextrow, 4) ws.Cells(nextrow, 4).Value = ws.Cells(nextrow, 4).Value ActiveWorkbook.Save FinalRow = ws.Range("a65536").End(xlUp).Row With Worksheets("Weather") With Range("a3:d" & FinalRow) .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="=RC3=Showers" .FormatConditions(1).Interior.ColorIndex = 4 .FormatConditions.Add Type:=xlExpression, Formula1:="=RC3=Rain" .FormatConditions(2).Interior.ColorIndex = 6 End With End With End Sub Thanks! |
All times are GMT +1. The time now is 07:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com