Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
VBA Error Message "Compile Error...." Steve Excel Discussion (Misc queries) 3 July 15th 05 09:20 AM
Excel XP error message Run Time Error 91 Lenny[_3_] Excel Programming 1 March 3rd 05 10:15 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"