PC Review


Reply
Thread Tools Rate Thread

Copy and Paste down the column

 
 
ExcelNovice
Guest
Posts: n/a
 
      31st Dec 2007
I need a macro to copy the first cell in a row down the column until it runs
into a existing value and then copy that value down until it meets another
existing value and then copy that value down the column and so on.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      31st Dec 2007
Debra Dalgleish shares a manual technique and a code solution:
http://contextures.com/xlDataEntry02.html

ExcelNovice wrote:
>
> I need a macro to copy the first cell in a row down the column until it runs
> into a existing value and then copy that value down until it meets another
> existing value and then copy that value down the column and so on.


--

Dave Peterson
 
Reply With Quote
 
Ken Hudson
Guest
Posts: n/a
 
      31st Dec 2007
Hi,

Please make a back up copy of your workbook before testing. This macro
assumes that the data you want to copy is in column A.

Option Explicit

Dim RowCount As Double
Dim Iloop As Double
Sub CopyDown()

'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False

RowCount = Cells(Rows.Count, "A").End(xlUp).Row
For Iloop = 1 To RowCount
If IsEmpty(Cells(Iloop, "A")) Then
Cells(Iloop, "A") = Cells(Iloop - 1, "A")
End If
Next Iloop

''Turn on warnings, etc.
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub
--
Ken Hudson


"ExcelNovice" wrote:

> I need a macro to copy the first cell in a row down the column until it runs
> into a existing value and then copy that value down until it meets another
> existing value and then copy that value down the column and so on.

 
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
copy/paste in the next column Nicawette Microsoft Excel Programming 4 30th Jan 2010 04:03 AM
Copy/paste a column? Steve Microsoft Outlook 1 16th Mar 2008 01:17 AM
Copy/paste Column Ray Microsoft Excel Programming 7 27th Nov 2006 08:21 PM
Save column J only using copy/paste & temporary copy mikeburg Microsoft Excel Programming 2 7th Jun 2006 05:37 PM
Copy Column and Paste =?Utf-8?B?c3RldmVo?= Microsoft Excel Programming 2 2nd Feb 2004 01:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 AM.