View Single Post
 
Old 07-26-2017, 11:22 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

SR,

Yes range is a method of Selection among other things but when declared as a variable, it is an object. Step through this code and watch your locals window.

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 7/26/2017
Dim oRng As Object
Dim oRng1 As Range
Dim oRng2
  Set oRng = Selection.Range
  Set oRng = Selection.Range
  Set oRng2 = Selection.Range
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote