View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike[_31_] Mike[_31_] is offline
external usenet poster
 
Posts: 38
Default Automatic coping on 2 column

You didn't exactly explain what are you trying to do.
Macro recorder tosses in all kinds of extra crap that you
don't need, such as scroll right, and doesn't really do
things efficiently so explaining what you are trying to do
is usually better then posting a macro recording and
asking someone to fix it.

Are you simply trying to copy column F (from row 2 down to
the last row) over to column T? If so then this one line
of code will do the trick.

Range("T2:T" & Range("F65536").End(xlUp).Row).Value = Range
("F2:F" & Range("F65536").End(xlUp).Row).Value


Or if you must find "Not Found" in column P then:

n_row = 1
Do While Cells(n_row, 16) = "NOT FOUND"
Cells(n_row,20).Value = Cells(n_row,5).Value
n_row = nrow + 1
Loop




-----Original Message-----
Hi,
i have 2 Sub, the first is on 2 cells, but i must put on
all column "F"
1-This is the first
Sub Macro4()
ActiveWindow.SmallScroll ToRight:=-2
Range("E73").Select
Selection.Copy
ActiveWindow.Zoom = 75
Range("Q73").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("E73").Select
ActiveSheet.Paste
Range("E76").Select
Application.CutCopyMode = False
Selection.Copy
Range("Q76").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.ClearContents
Range("E76").Select
Selection.Copy
Range("Q76").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("E76").Select
ActiveSheet.Paste
End Sub
-------------------------------------
2-this the second sub TO CORRECT
-------------------------------------
Sub second ()
n_row = 2
Do While Cells(n_row, 16) = "NOT FOUND"


Cells(n_row, 5).Select
Selection.Copy

Cells(n_row, 20).Select
'Here i need a special pasting
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Cells(n_row, 5).Select
Selection.Copy
'Cells(n_row, 15) = Val(Cells(n_row, 2))
n_row = n_row + 1
Loop
End Sub

How can i correct?
Thanks
.