![]() |
label_to_number
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 |
label_to_number
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 |
label_to_number
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 |
All times are GMT +1. The time now is 05:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com