Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Jeff,
I'm not entirely sure what you're trying to do, but here is some code that is similar to yours but does not throw and error. HTH Graham Sub trimit() Dim a As Long Dim myRng As Range For a = 7 To 100 Set myRng = Sheets('Sheet1").Range("A7:a100") x = Mid(Application.Trim(myRng.Cells(a)), 12, 20) If a Mod 2 = 0 Then If Cells(a, 1).Value 0 Then Cells(a, 2).Value = x Else Cells(a, 2).Value = 0 End If End If Next a End Sub Jeff wrote: Hello, I urgently need help with my VBA procedure. I'm getting the following erro msg "Run-time '450' Here's my VBA procedure Sub trimit() Dim a As Long Dim myRng As Range For a = 7 To 100 x = Mid(Application.Trim(Cells(a, 1).Range), 12, 20) If a Mod 2 = 0 Then If Cells(a, 1).Value 0 Then Cells(a, 2).Value = x Else Cells(a, 2).Value = 0 End If End If Next a -- Regards, Jeff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hot key for time? | New Users to Excel | |||
Hot key for time? | Excel Worksheet Functions | |||
time sheet drop down lists | Excel Discussion (Misc queries) | |||
time entry with am/pm and no colons | Excel Discussion (Misc queries) | |||
Formula for a time card | Excel Worksheet Functions |