Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
conditional copy of column to another column of same worksheet
Hi,
Please can anyone assist in my requiremnet which is as I need to copy content of column 32, row 3 onwards to any column between column 33 to column 256, containning current date. Column 33 to 256, row 2 , contain dates of all the coming days. If I am running it today(17-Apr-10), column 32 (AF) ROW 3 onwards should be copied to any column AI, row 3 onwards. ------------------------------------------------------------------------------------------------------------------------------------------------------------- COLUMNS AF AH AI AJ ............................................ IV Row 1 details blank row2 16-apr-10 17-apr-10 18- apr-10............................................... 18-JUL-10 ROW3 Peter row4 Joy Row 5 Smith Row6 kallis ------------------------------------------------------------------------------------------------------------------------------------------------------------- My earlier code is not working on all the columns, donot know why ? ================================================== ======== Sub vert() Dim lc As Long, sh As Worksheet, rng As Range Dim lr As Long, cRng As Range Set sh = ActiveSheet lc = sh.Cells(2, Columns.Count).End(xlToLeft).Column Set rng = sh.Range("C31", sh.Cells(2, lc)) lr = sh.Cells(Rows.Count, 32).End(xlUp).Row Set cRng = sh.Range(sh.Cells(3, 32), Cells(lr, 32)) For Each c In rng If c = Date Then cRng.Copy c.Offset(1, 0) End If Next End Sub ============================================ Regards sanjay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF conditional to copy column from one spreadsheet to another | Excel Worksheet Functions | |||
Copy conditional formatting across column in the same row | Excel Worksheet Functions | |||
how to copy contents of one column to another column in another worksheet | Excel Discussion (Misc queries) | |||
Copy column A and column D from all sheets into new worksheet | Excel Programming | |||
Copy column B and column E from all sheets into new worksheet | Excel Programming |