?
Solved

Copy data from above cell

Posted on 2014-03-18
4
Medium Priority
?
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 52

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 52

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot 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.

762 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