Macro for copy paste until blank
Solved/Closed
J
-
Mar 5, 2010 at 09:42 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 13, 2010 at 11:20 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 13, 2010 at 11:20 AM
Related:
- Macro for copy paste until blank
- Spell number in excel without macro - Guide
- Copy and paste fonts - Guide
- How to paste photo in resume - Guide
- This message was deleted text copy and paste - Android Forum
- An example of a cell is a blank cell ✓ - Programming Forum
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 5, 2010 at 10:32 AM
Mar 5, 2010 at 10:32 AM
Based on your sample data, if the macro runs, how would it look like. Also how one can say this is a customer name and this is junk?
Mar 5, 2010 at 10:50 AM
If I create a new column next to the data for my formula
=if(the cell above customer name =0,customer name, cell above this one)
And the result is this
SUN150 SUN150
R SUN150
R SUN150
R SUN150
R SUN150
R SUN150
R SUN150
R SUN150
R SUN150
R SUN150
SUN150
SUN400 SUN400
R SUN400
R SUN400
R SUN400
R SUN400
Mar 5, 2010 at 12:06 PM
Also you have not mentioned, how can I say that "R" is not a customer name ?
Any how, you may have to modify this a bit based on answers
Assumption is data is starting from Row 1
Mar 5, 2010 at 12:10 PM
Mar 13, 2010 at 11:13 AM
Please suggest me a macro to use based on your above quey.
Example
Anil
blank
blank
blank
rajesh
blank
blank
blank
blank
blank
blank
Amit
Blank
i want the first row like to fillup the nest three blank and than take up the rajesh and fillup the next 6 blank and continue
Mar 13, 2010 at 11:20 AM
Dim lLastRow As Long
Dim lCounter As Long
Dim sThisCust As String
lLastRow = Cells(Rows.Count, "A").End(xlUp).Row
sThisCust = Cells(1, "A")
For lCounter = 2 To lLastRow
If Trim((Cells(lCounter, "A")) = "") Then
Cells(lCounter, "A") = sThisCust
else
sThisCust = Cells(lCounter, "A")
End If
Next
End Sub