View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Simon Lloyd[_361_] Simon Lloyd[_361_] is offline
external usenet poster
 
Posts: 1
Default MACRO, syntax for move to different column


Firstly where are you using this code? in a standard module or a
worksheet module? if a worksheet module what event?

Secondly i'd like to bet your code doesn't even compile as you haven't
qualified some things like this line for instance
Code:
--------------------
If Not Intersect(Me.Range(J3), .Cells) Is Nothing Then
--------------------
you haven't qualified .Cells, if there is more code to this then please
supply all the code rather than snip out what you think we need to help
you, this way we can give you an answer that will be helpful!

MrDave;449742 Wrote:
hi, I am using a keyboard shortcut for some copying tasks.
Offset can get to work, but does not suit purpose here.
would like to use a named range, to maintain integrity of sheet, moving
columns..
thanks

Named Ranges represent columns (from & to):

Dim M2 As String
M2 = Range("M2")
Dim N3 As String
N3 = Range("N3")

'does not work in a Sub(); wish to change columns
If Not Intersect(Me.Range(J3), .Cells) Is Nothing Then 'all
With Me.Cells(.Row, J2).Select
End With
End If



not working: how do I correct this, for the next item after:
Selection(ActiveSheet.Row, N3).Select 'does not work


Sub Paste2() 'alt-/ (slash)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=190

'NEED TO MOVE TO A DIFFERENT COLUMN FROM HERE

End Sub



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=124510