Solved

Copy data from above cell

Posted on 2014-03-18
4
151 Views
Last Modified: 2014-03-18
I found the below code on EE posted by: zorvek (Kevin Jones) but it stops after the first occurence. I need this to loop to the end. Can someone let me know what is needed to make the macro copy every cell that is blank with the same details as the cell above until the end.



Sub SelectAccount()

     If Len(Selection.Value) = 0 Then
       Selection.Value = Selection.Offset(-1).Value
   Else
       Selection.Offset(1).Select
   End If


End Sub


Thanks
0
Comment
Question by:Jagwarman
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39936253
Hi,

Until which end?  maybe not Row 1048576

Could you precise?

Regards
0
 

Author Comment

by:Jagwarman
ID: 39936255
Until row 500

tks
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39936259
Hi,

pls try

Do
     If Len(Selection.Value) = 0 Then
       Selection.Value = Selection.Offset(-1).Value
   Else
       Selection.Offset(1).Select
   End If
Loop Until Selection.Row = 501

Open in new window

Regards
0
 

Author Closing Comment

by:Jagwarman
ID: 39936263
Thanks Rgonzo1971 you never fail me
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question