When I create a graph after using range.copy and range.paste it leaves the paste range selected, and then when I create a graph a few lines later, it uses the selection as the f
If you select a cell in an already selected range, it will not work. But, Selecting a range outside the original selection will clear the original selection.
'* The original selection *' ActiveSheet.range("A1:K10").Select
'* New Selections *' Activesheet.Range("L1").Select
'* Then *' Activesheet.Range("A1").Select
Do statement as below:
ActiveSheet.Cells(ActiveWindow.SplitRow+1,ActiveWindow.SplitColumn+1).Select
There is a way to SELECT NOTHING that solve your problem.
When you want that Excel SELECT NOTHING do it:
MYDOC.Shapes("Ready").visible=True
MYDOC.Shapes("Ready").Select
MYDOC.Shapes("Ready").visible=False
This HIDE the selection and nothing still selected in your window PLUS: The word "Ready" is shown at the Left Top in your Sheet.
Selection(1, 1).Select
will select only the top left cell of your current selection.
I do not think that this can be done. Here is some code copied with no modifications from Chip Pearson's site: http://www.cpearson.com/excel/UnSelect.aspx.
UnSelectActiveCell
This procedure will remove the Active Cell from the Selection.
Sub UnSelectActiveCell()
Dim R As Range
Dim RR As Range
For Each R In Selection.Cells
If StrComp(R.Address, ActiveCell.Address, vbBinaryCompare) <> 0 Then
If RR Is Nothing Then
Set RR = R
Else
Set RR = Application.Union(RR, R)
End If
End If
Next R
If Not RR Is Nothing Then
RR.Select
End If
End Sub
UnSelectCurrentArea
This procedure will remove the Area containing the Active Cell from the Selection.
Sub UnSelectCurrentArea()
Dim Area As Range
Dim RR As Range
For Each Area In Selection.Areas
If Application.Intersect(Area, ActiveCell) Is Nothing Then
If RR Is Nothing Then
Set RR = Area
Else
Set RR = Application.Union(RR, Area)
End If
End If
Next Area
If Not RR Is Nothing Then
RR.Select
End If
End Sub
Tried all your suggestions, no luck , but here's an idea that worked for me select a cell out of your selection range (say AAA1000000) and then select the A1 again
Range("AAA1000000").Activate
Range("A1").Activate
Guy