PC Review


Reply
Thread Tools Rate Thread

conditional copy of column to another column of same worksheet

 
 
sanju
Guest
Posts: n/a
 
      16th Apr 2010
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically fill column with conditional data from other worksheet noot Microsoft Excel Discussion 8 28th Apr 2010 11:19 PM
Copy worksheets to new worksheet and add a worksheet name column to new sheet. Lib Microsoft Excel Programming 1 22nd Feb 2007 04:30 PM
how to copy contents of one column to another column in another worksheet yefei Microsoft Excel Misc 3 25th Feb 2006 05:57 PM
Copy column A and column D from all sheets into new worksheet al007 Microsoft Excel Programming 1 21st Jan 2006 10:49 AM
Copy column B and column E from all sheets into new worksheet al007 Microsoft Excel Programming 2 21st Jan 2006 07:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:32 AM.