Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Focus from embedded chart

Status
Not open for further replies.

Mantle51

Programmer
Joined
Aug 17, 2006
Messages
97
Location
US
Hello,
I've created a chart embedded in a sheet. After formatting, I'm trying to give focus back to spreadsheet. I've tried Sheets.activate .Select and even Sendkeys "{ESC}". Nothing works and I dont' want to select range b/c I don't know what it is through each iteration.

THis is what I've got...

Charts.Add
ActiveChart.Location Where:=xlLocationAsObject, Name:="TOnly"
ActiveChart.ChartType = xlLine

If i < 7 Then
RngStart = Left(RngStart, 1) & ":" & Mid(RngStart, 2, 2)
RngEnd = Left(RngEnd, 1) & ":" & Mid(RngEnd, 2, 2)

Else: RngStart = Left(RngStart, 2) & ":" & Mid(RngStart, 3, 2)
RngEnd = Left(RngEnd, 2) & ":" & Mid(RngEnd, 3, 2)
End If

With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = RngStart & " - " & RngEnd
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
.HasLegend = False
End With
Sheets("5_min").select '???
 



Hi,

Check out the DeSelect method of the Chart Object.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top