Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
AUTOMATIC COLUMN TRACKING Kanmi Excel Worksheet Functions 0 June 24th 09 06:41 PM
Automatic sum of a column when the other column has the same vaule Andy Excel Discussion (Misc queries) 7 July 29th 08 04:59 AM
Automatic filtering and coping result to a seperate sheet Richard P Excel Worksheet Functions 2 April 23rd 06 07:28 PM
Automatic Text to column dinesh Excel Discussion (Misc queries) 1 June 10th 05 02:38 PM
coping ben kiser New Users to Excel 1 April 11th 05 01:41 PM


All times are GMT +1. The time now is 09:56 PM.

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

About Us

"It's about Microsoft Excel"