Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
Though my code runs well, if I run it the second time, though I have issued the statement "counter=0", it starts from the last used value. The code is like this: counter = 0 For Each c In Worksheets("Sheet1").Range("A2:A100").Cells valie = c.Value If c.Value = 22381 Then wala = c.Offset(0, 5).Value If wala = "pills" Then milla = c.Offset(0, 2).Value Call file_write End If End If Next c counter = 0 End Sub Sub file_write() Set wkbk = Nothing On Error Resume Next Set wkbk = Workbooks("sample-2.xls") On Error GoTo 0 If wkbk Is Nothing Then Workbooks.Open FileName:="C:\milinda\sample-2.xls" End If Range("E" & counter + 1).Value = milla Selection.NumberFormat = "#,##0.00" counter = counter + 1 End Sub How to cope with this ? Milind --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Office 2007 trial is very slow. Is this because it's a trial | Excel Discussion (Misc queries) | |||
Trial only | Excel Discussion (Misc queries) | |||
download trial version excel 2003? can only find trial version 200 | Excel Discussion (Misc queries) | |||
Trial Has Expired and I can't open spreadsheet created in trial - | Excel Worksheet Functions | |||
Reset Counter | Excel Discussion (Misc queries) |