Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have the following code in my Excel Macro. While running this macro I am getting the following error "Method 'Range' of object '_Global' failed" What is wrong with this code Dim i As Long Dim s As String i = 1 While (1) s = "G" + CStr(i) If Range(s).Value = "Completed" Then Range(s).EntireRow.Hidden = True End If i = i + 1 Wend Regards, Moahn. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mohanasundaram,
No termination possible with "While (1)" try - Dim i As Long Dim s As String i = 1 While (i <= Cells.Rows.Count) s = "G" + CStr(i) If Range(s).Value = "Completed" Then Range(s).EntireRow.Hidden = True End If i = i + 1 Wend regards, John "Mohanasundaram" wrote in message om... Hi All, I have the following code in my Excel Macro. While running this macro I am getting the following error "Method 'Range' of object '_Global' failed" What is wrong with this code Dim i As Long Dim s As String i = 1 While (1) s = "G" + CStr(i) If Range(s).Value = "Completed" Then Range(s).EntireRow.Hidden = True End If i = i + 1 Wend Regards, Moahn. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range of Object _Global Failed | Charts and Charting in Excel | |||
Method 'Range' of object '_global' failed | Excel Discussion (Misc queries) | |||
runtime error 1004 method range of object '_global failed | Excel Discussion (Misc queries) | |||
Method 'Run' of object '_Global' failed when changing OS and Office versions | Excel Programming |