View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
MrDave MrDave is offline
external usenet poster
 
Posts: 34
Default MACRO, syntax for move to different column

hi, thanks, thats what I'm asking, don't know that much about macro's / vba..
I'm in a Module where use short cut keys made in toolbars, couple of items
similar included here, but just need method of moving from 1 column to
another (in modules), want to use a named range for dynamic movement of
columns sake..... part of a copy-paste operation..... really just need
syntax on moving from 1 col to another.

I got the part about it doesn't work, came up on 20 attempts 1 day, 20 more
today.
examples working with:


Sub Copy() 'alt-, (comma) wip: copy column 190 rows down from active
cell, pending
'reduce all windows, restore main window, pause conflict with ie, etc.
click button does not work
Range(ActiveCell, ActiveCell.Offset(190, 0)).Copy
End Sub

Sub Paste1() 'alt-. (period) works: paste values to syma
ActiveSheet.PasteSpecial Format:=3, Link:=1, DisplayAsIcon:=False, _
IconFileName:=False
End Sub

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


Worksheet(.Row, N3).Select 'invalid or unqualified reference

End Sub


partial on other attempts:

'With Selection(.Row, N3).Select 'invalid or unqualified reference, been
here before?
'End With

'With Selection
'With ActiveSheet(.Row, N3).Select 'object doesn't support this
property or method
'End With
'End With

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

'If Not Intersect(ActiveSheet.Range(M2), .Cells) Is Nothing Then 'no
'With ActiveSheet.Cells(.Row, N3).Select
'End With
'End If

'ActiveSheet.Row, (N3).Select 'no
'Selection(ActiveSheet.Row, N3).Select 'no
'Selection(ActiveCell.Row, N3).Select 'did something, jumped 2k rows
down though

'With Ativesheet(N3).Select '
'With Selection(N3).Select 'type mismatch
'With Selection(.Row, N3).Select 'no
'With Me.Cells(.Row, N3).Select 'no

'Range ActiveRow(.Row, N3).Select 'invalid or unqualified reference

'Range ActiveRow(.Row, N3).Select 'invalid or unqualified reference
'ActiveRow(.Row, N3).Select 'invalid or unqualified reference
'ActiveRow(N3).Select 'sub or function not defined

'ActiveSheet.Row(N3).Select 'no
'Range(ActiveSheet, ActiveSheet.Row, N3).Select 'no
'Range(ActiveSheet.Row, N3).Select 'not work
'ActiveSheet(.Row, N3).Select 'not work

'Range(ActiveSheet, ActiveCell.Offset(190, 0)).Copy
'End With

'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 'original
' 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