Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone correct macro below - Getting error : "Method 'Range' of
object_Global failed. Sub label_to_number() Dim addr As String For Each Window In Windows For Each Worksheet In Window.SelectedSheets For Each cell In Application.Selection addr = Worksheet.Name & "!" & cell.Address If IsNumeric(Range(addr).Value) = True And Range(addr).Text < "" And Range(addr).HasFormula = False Then Range(addr) = Val(Range(addr)) End If Next cell Next Worksheet Next Window End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Probably you require to give the parent of the RANGE you have used.
For instance: Worksheets("Sheet1").Range(addr).Value Mangesh On Aug 8, 10:30 am, transferxxx wrote: Can someone correct macro below - Getting error : "Method 'Range' of object_Global failed. Sub label_to_number() Dim addr As String For Each Window In Windows For Each Worksheet In Window.SelectedSheets For Each cell In Application.Selection addr = Worksheet.Name & "!" & cell.Address If IsNumeric(Range(addr).Value) = True And Range(addr).Text < "" And Range(addr).HasFormula = False Then Range(addr) = Val(Range(addr)) End If Next cell Next Worksheet Next Window End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't think that's the solution as the macro need to work as a general macro
in any workbook with different sheet name. "Mangesh" wrote: Probably you require to give the parent of the RANGE you have used. For instance: Worksheets("Sheet1").Range(addr).Value Mangesh On Aug 8, 10:30 am, transferxxx wrote: Can someone correct macro below - Getting error : "Method 'Range' of object_Global failed. Sub label_to_number() Dim addr As String For Each Window In Windows For Each Worksheet In Window.SelectedSheets For Each cell In Application.Selection addr = Worksheet.Name & "!" & cell.Address If IsNumeric(Range(addr).Value) = True And Range(addr).Text < "" And Range(addr).HasFormula = False Then Range(addr) = Val(Range(addr)) End If Next cell Next Worksheet Next Window End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|