S
Skin Paul
Hi all, using xl 2004 version 11.3.5
Have spent many hours trying to work this out but to no avail.
Question is: How do I get a return value of cell count for for a selection
that has no known parameters? If I know either the number of columns
or rows I can use the below macro to determine the last cell and make it
active. In this macro I know that it has 15 columns. Please excuse poor
Procedure. I would like to activate the last cell in a random selection
After copying and pasting values only. As this would be part of a larger
Procedure I can't just simply select the cell.
Thanks Paul.
Sub Inplace()
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
'Roc equals Row counter
'Ae equals cell count per row
Roc = 0
For Ae = 16 To 2000 Step 15
If Selection.Cells.Count < Ae Then
ActiveCell.Offset(Roc, 14).Range("A1").Select
Exit Sub
End If
Roc = Roc + 1
Next Ae
End Sub
Have spent many hours trying to work this out but to no avail.
Question is: How do I get a return value of cell count for for a selection
that has no known parameters? If I know either the number of columns
or rows I can use the below macro to determine the last cell and make it
active. In this macro I know that it has 15 columns. Please excuse poor
Procedure. I would like to activate the last cell in a random selection
After copying and pasting values only. As this would be part of a larger
Procedure I can't just simply select the cell.
Thanks Paul.
Sub Inplace()
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
'Roc equals Row counter
'Ae equals cell count per row
Roc = 0
For Ae = 16 To 2000 Step 15
If Selection.Cells.Count < Ae Then
ActiveCell.Offset(Roc, 14).Range("A1").Select
Exit Sub
End If
Roc = Roc + 1
Next Ae
End Sub