Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do I change the code so it will copy the content of column B to column C?
A B C Dog 2007-10-22 Cat 2008-02-02 2008-02-02 Cat 2008-02-11 Here are the codes: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row ..Range("K2:K" & LastRow).Formula _ = "= IF(A2=""Cat"", B2, "" "")" End With Thanks, Aline -- Aline |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dim LastRow As Long
Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("C2:C" & LastRow).Formula _ = "= IF(A2=""Cat"",B2,"" "")" End With -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Aline" wrote in message ... How do I change the code so it will copy the content of column B to column C? A B C Dog 2007-10-22 Cat 2008-02-02 2008-02-02 Cat 2008-02-11 Here are the codes: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("K2:K" & LastRow).Formula _ = "= IF(A2=""Cat"", B2, "" "")" End With Thanks, Aline -- Aline |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, it should be:
".Range("C2:C" & LastRow).Formula _" But I still not sure how do I rewrite the code so it automaticaly copy the date on C3. -- Aline "Bob Phillips" wrote: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("C2:C" & LastRow).Formula _ = "= IF(A2=""Cat"",B2,"" "")" End With -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Aline" wrote in message ... How do I change the code so it will copy the content of column B to column C? A B C Dog 2007-10-22 Cat 2008-02-02 2008-02-02 Cat 2008-02-11 Here are the codes: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("K2:K" & LastRow).Formula _ = "= IF(A2=""Cat"", B2, "" "")" End With Thanks, Aline -- Aline |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I don't understand that bit.
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Aline" wrote in message ... Thanks, it should be: ".Range("C2:C" & LastRow).Formula _" But I still not sure how do I rewrite the code so it automaticaly copy the date on C3. -- Aline "Bob Phillips" wrote: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("C2:C" & LastRow).Formula _ = "= IF(A2=""Cat"",B2,"" "")" End With -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Aline" wrote in message ... How do I change the code so it will copy the content of column B to column C? A B C Dog 2007-10-22 Cat 2008-02-02 2008-02-02 Cat 2008-02-11 Here are the codes: Dim LastRow As Long Dim wks As Worksheet Set wks = ActiveSheet With wks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("K2:K" & LastRow).Formula _ = "= IF(A2=""Cat"", B2, "" "")" End With Thanks, Aline -- Aline |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Range("B:B").Copy Range("C:C")
will copy column B to column C -- Gary''s Student - gsnu200796 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a macro i can use to copy a cell +1 | Excel Discussion (Misc queries) | |||
Macro copy function | Excel Discussion (Misc queries) | |||
copy name from active sheet to cell - using macro or function | Excel Worksheet Functions | |||
Using macro to copy a part of a cell content to next cell | Excel Discussion (Misc queries) | |||
If than copy function / Macro | Excel Worksheet Functions |