ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can i get rid of an error message (https://www.excelbanter.com/excel-programming/341095-can-i-get-rid-error-message.html)

matthewwookie[_5_]

Can i get rid of an error message
 

Hello all

Everytime i run a specific macro i get the same run time error...which
i have now worked out is just referencing the highlighted cell on a
particular page. The macro itself works fine so i want to stop the run
time error appearing.

So is there a way i can write a script that will stop it appearing? Or
is there a macro that just get rid of it when it appears.

Thanks

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile: http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470711


Norman Jones

Can i get rid of an error message
 
Hi Matthew,

A run-time error is an error and needs to be corrected or handled.

Post your code and indicate the error you get and also where the error
occurs.


---
Regards,
Norman



"matthewwookie"
wrote in message
news:matthewwookie.1vyqie_1127732717.9811@excelfor um-nospam.com...

Hello all

Everytime i run a specific macro i get the same run time error...which
i have now worked out is just referencing the highlighted cell on a
particular page. The macro itself works fine so i want to stop the run
time error appearing.

So is there a way i can write a script that will stop it appearing? Or
is there a macro that just get rid of it when it appears.

Thanks

Matt


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile:
http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470711




matthewwookie[_6_]

Can i get rid of an error message
 

heres the code

Sub ActIssuedIso()
'
' ActIssuedIso Macro
' Macro recorded 26/09/2005 by bbnr843
'

'
Range("G9:G2145").Select
Range("C8:U2145").Sort Key1:=Range("G9"), Order1:=xlAscending
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("C9").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:
_
"Sheet1!R8C3:R1007C21").CreatePivotTable TableDestination:=""
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3
1)
ActiveSheet.Cells(3, 1).Select
Wit
ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth")
.Orientation = xlRowField
.Position = 1
End With
Range("A8:A10").Select

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200510").Position = 3

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200511").Position = 4

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200512").Position = 5
ActiveSheet.PivotTables("PivotTable1").AddDataFiel
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Count"), "Sum of Count", xlSum
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Priorit
Status")
.Orientation = xlColumnField
.Position = 1
End With
Range("F12").Select
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("Sheet6").Range("F12")
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.PlotArea.Select
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True



The red text is where the issue is. Range ("F12") seems to be th
location of the cell thats been clicked on before exiting.

Any help would be great.

matt
End Su

--
matthewwooki
-----------------------------------------------------------------------
matthewwookie's Profile: http://www.excelforum.com/member.php...fo&userid=2750
View this thread: http://www.excelforum.com/showthread.php?threadid=47071


matthewwookie[_7_]

Can i get rid of an error message
 

Hi

heres the code

Sub ActIssuedIso()
'
' ActIssuedIso Macro
' Macro recorded 26/09/2005 by bbnr843
'

'
Range("G9:G2145").Select
Range("C8:U2145").Sort Key1:=Range("G9"), Order1:=xlAscending
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("C9").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:
_
"Sheet1!R8C3:R1007C21").CreatePivotTable TableDestination:=""
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3
1)
ActiveSheet.Cells(3, 1).Select
Wit
ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth")
.Orientation = xlRowField
.Position = 1
End With
Range("A8:A10").Select

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200510").Position = 3

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200511").Position = 4

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems
_
"200512").Position = 5
ActiveSheet.PivotTables("PivotTable1").AddDataFiel
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Count"), "Sum of Count", xlSum
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Priorit
Status")
.Orientation = xlColumnField
.Position = 1
End With
Range("F12").Select
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("Sheet6").Range("F12")
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.PlotArea.Select
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True

The red is where the issue is...range f12 is the location of the las
cell clicked on before i left that page!

Any help would be great. if you need anything else please just let m
know.

matt
End Su

--
matthewwooki
-----------------------------------------------------------------------
matthewwookie's Profile: http://www.excelforum.com/member.php...fo&userid=2750
View this thread: http://www.excelforum.com/showthread.php?threadid=47071


Norman Jones

Can i get rid of an error message
 
Hi Matthew,

The red is where the issue is


Reading plain text NG posts, in common with most contributors to the NG) I
am unable to see your 'red' data.

Please, therefore, post the single offending line and describe the reported
error.

---
Regards,
Norman



"matthewwookie"
wrote in message
news:matthewwookie.1vyyug_1127743529.5308@excelfor um-nospam.com...

Hi

heres the code

Sub ActIssuedIso()
'
' ActIssuedIso Macro
' Macro recorded 26/09/2005 by bbnr843
'

'
Range("G9:G2145").Select
Range("C8:U2145").Sort Key1:=Range("G9"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("C9").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"Sheet1!R8C3:R1007C21").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3,
1)
ActiveSheet.Cells(3, 1).Select
With
ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth")
Orientation = xlRowField
Position = 1
End With
Range("A8:A10").Select

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems(
_
"200510").Position = 3

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems(
_
"200511").Position = 4

ActiveSheet.PivotTables("PivotTable1").PivotFields ("YearMonth").PivotItems(
_
"200512").Position = 5
ActiveSheet.PivotTables("PivotTable1").AddDataFiel d
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Count"), "Sum of Count", xlSum
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Priority
Status")
Orientation = xlColumnField
Position = 1
End With
Range("F12").Select
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("Sheet6").Range("F12")
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.PlotArea.Select
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True

The red is where the issue is...range f12 is the location of the last
cell clicked on before i left that page!

Any help would be great. if you need anything else please just let me
know.

matt
End Sub


--
matthewwookie
------------------------------------------------------------------------
matthewwookie's Profile:
http://www.excelforum.com/member.php...o&userid=27503
View this thread: http://www.excelforum.com/showthread...hreadid=470711





All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com