Hi
Try

Sub fillUp()
Dim lLastRow As Long
Dim lCounter As Long
Dim sThisCust As String
lLastRow = Cells(Rows.Count, "B").End(xlUp).Row
sThisCust = Cells(1, "B")
For lCounter = 2 To lLastRow
If Trim((Cells(lCounter, "B")) = "") Then
Cells(lCounter, "B") = sThisCust
Else
sThisCust = Cells(lCounter, "B")
End If
Next
End Sub


On Sun, May 15, 2011 at 10:12 PM, ashish koul <koul.ash...@gmail.com> wrote:

> try this
>
> http://www.contextures.com/xlDataEntry02.html
>
> Fill Blank Cells From Above
> http://www.contextures.com/Excel-Videos-Data-Entry.html#FillBlanks
>
>
> On Sun, May 15, 2011 at 11:34 AM, Prabhu <prabhugate...@gmail.com> wrote:
>
>> Hi friends,
>>
>> I need a macro for a selected column to fill previous cell
>> automatically where ever blank cell in the sheet.This Macro should
>> copy the previous cell content.I.e. B2 has "xxx" B3 and B4 is blank
>> means when we run the macro from B2 to B4 should show "xxx".
>>
>> Request. Filling must be column wise not row wise.
>>
>> Regards,
>>
>> Prabhu
>>
>> --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> Like our page on facebook , Just follow below link
>> http://www.facebook.com/discussexcel
>>
>
>
>
> --
> *Regards*
> * *
> *Ashish Koul*
> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
> *akoul*.wordpress.com <http://akoul.wordpress.com/>
> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>
>
>
> P Before printing, think about the environment.
>
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to