LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Macro question, Copy-Paste

Perhaps you could just tell us what you are trying to do... From just reading
your code it is a bit hard to tell.

--
HTH...

Jim Thomlinson


"MrDave" wrote:

hi, thanks, I gave something a try.., but not working, not sure of the syntax
for..

Sub Paste2() 'alt-/ (slash)
Dim M2 As String
M2 = Range("M2")
Dim N3 As String
N3 = Range("N3")

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=190

ActiveSheet(.Row, N3).Select 'not working
Range(ActiveSheet, ActiveCell.Offset(190, 0)).Copy


'If Not Intersect(ActiveSheet.Range(M2)) Is Nothing Then 'wrong
' With ActiveSheet(.Row, N3).Select
' '.Offset(0, 0).Select
' End With
'End If

'If Not Intersect(Me.Range(M2), .Cells) Is Nothing Then 'wrong
' With Me.Cells(.Row, N3).Select
' '.Offset(0, 0).Select
' End With
'End If

'With Me.Cells(.Row, N3).Select
'Range(ActiveCell, ActiveCell.Offset(190, 0)).Copy

End Sub







"Jim Thomlinson" wrote:

Me refers to the parent object. Since you are in a standard module there is
no parent object.

Replace me with ActiveSheet.

also you have unqulified references. You have
If Not Intersect(Me.Range(M2), .Cells) Is Nothing Then
but the .Cells is not part of a with statement so it is unreferenced. Once
again activesheet will do.
--
HTH...

Jim Thomlinson


"MrDave" wrote:

hi, I am trying to pick columns from a keyboard short cut with macro located
under a General Module..? but I get an: Invalid use of Me keyword. is
there a way to make this work? thanks.

Sub Paste2() 'alt-/ (slash)
Dim M2 As String
M2 = Range("M2")
Dim N3 As String
N3 = Range("N3")

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=190
ActiveCell.Offset(190, 0).Select

If Not Intersect(Me.Range(M2), .Cells) Is Nothing Then
With Me.Cells(.Row, N3).Select
'.Offset(0, 0).Select
End With
End If

'With Me.Cells(.Row, N3).Select
'Range(ActiveCell, ActiveCell.Offset(190, 0)).Copy

End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste Question stew Excel Discussion (Misc queries) 12 November 9th 08 07:45 PM
Yet another copy/paste macro question Btate0121 Excel Discussion (Misc queries) 6 November 3rd 08 10:45 PM
Copy/Paste Question DoubleZ Excel Discussion (Misc queries) 3 September 24th 08 11:13 PM
Copy/Paste question Dan Excel Worksheet Functions 0 February 22nd 07 12:55 AM
Copy Paste Question lcannon Excel Discussion (Misc queries) 1 June 14th 05 12:48 AM


All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"