Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic coping on 2 column
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic coping on 2 column explain
I 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 HEre i need a code like down n_row = nrow + 1 Loop ----Ok but i also must cut and like this down 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
AUTOMATIC COLUMN TRACKING | Excel Worksheet Functions | |||
Automatic sum of a column when the other column has the same vaule | Excel Discussion (Misc queries) | |||
Automatic filtering and coping result to a seperate sheet | Excel Worksheet Functions | |||
Automatic Text to column | Excel Discussion (Misc queries) | |||
coping | New Users to Excel |