LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default IF function (copy cell) in a macro

I still do get it, can anyone help me with this?

Thanks,
-- 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("C2:C" & LastRow).Formula _
= "= IF(A2=""Cat"", B2, "" "")"
End With
Thanks,
Aline
--
Aline



Aline
 
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
IF function (copy cell) in a macro Aline Excel Discussion (Misc queries) 4 July 28th 08 06:32 PM
Macro copy function Nick Krill Excel Discussion (Misc queries) 1 April 4th 07 07:03 PM
copy name from active sheet to cell - using macro or function dymek Excel Worksheet Functions 2 October 2nd 06 12:32 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
If than copy function / Macro Sweetetc Excel Worksheet Functions 2 April 7th 06 06:30 PM


All times are GMT +1. The time now is 06:59 PM.

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

About Us

"It's about Microsoft Excel"