Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Copy and Paste down the column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ExcelNovice - 31 Dec 2007 22:04 GMT
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 - 31 Dec 2007 23:10 GMT
Debra Dalgleish shares a manual technique and a code solution:
http://contextures.com/xlDataEntry02.html

> 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.

Signature

Dave Peterson

Ken Hudson - 31 Dec 2007 23:27 GMT
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
Signature

Ken Hudson

> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.