darkdimension
New Member
- Joined
- May 30, 2010
- Messages
- 20
The following code does not allow the 'CurrentRegion' to be selected and 'Set'. I believe it has to do with the pasting does not retain focus of the table that 'Database' creates.
Range("Database").Copy
Range("A2800").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'Selection.Sort Key1:=Range("M2801"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Set Itemlist = Selection.CurrentRegion
If I sort (ie, remove comment) the list before I try to 'Set', all is fine.
How do I gain focus and set the 'Database' table to the array?
Thank you in advance.
Range("Database").Copy
Range("A2800").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'Selection.Sort Key1:=Range("M2801"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Set Itemlist = Selection.CurrentRegion
If I sort (ie, remove comment) the list before I try to 'Set', all is fine.
How do I gain focus and set the 'Database' table to the array?
Thank you in advance.
Last edited: