how to repeat column B names. Is there any another way rather than dragging the cells?

srija

New Member
Joined
Jan 29, 2020
Messages
22
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
Please help me that how can we repeat column B names (vamsi and suresh) until cell value = EOH12 (column A).

A column I B column
E0H11 vamsi
E0H24 suresh
E0H01 (Repeat here)
E0H54 (Repeat here)
EOH12 (Repeat here)

Output should be like:
A column I B column

E0H11 vamsi
E0H24 suresh
E0H01 vamsi
E0H54 suresh
EOH12 vamsi

Please help me out:)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
What you want do could overwrite the original name list (like in your sample where row 2 is hidden).
You will need to maintain the name list somewhere else.

I'll leave for someone else to work it out.
 
Upvote 0
or help me on it. if i don't want to add names for specific cell for ex: "E0H1" cell then How can I exclude this on autofilter?
 
Upvote 0
See if this does it.

Put the names starting at A2 on "Sheet2".
Filter out the column A values for which you do not want names assigned (you do not need to filter out blanks, but can if you want).
Then run this :
VBA Code:
Sub RepeatNames()
Dim lr%, rng As Range, nRng As Range, x%, cel As Range
lr = Cells(Rows.Count, "A").End(3).Row
Set rng = Range("A2:A" & lr).SpecialCells(xlCellTypeVisible).Offset(0, 1)
With Sheets("Sheet2")
    Set nRng = .Range("A2:A" & .Cells(Rows.Count, "A").End(3).Row)
End With
x = 1
Application.ScreenUpdating = False
rng.ClearContents
For Each cel In rng
    If cel(1, 0) = "" Then GoTo n
    cel.Value = nRng(x)
    If x = nRng.Count Then
        x = 1
    Else: x = x + 1
    End If
n: Next
For Each cel In Intersect([B:B], ActiveSheet.UsedRange)
    If cel.EntireRow.Hidden Then cel.ClearContents
Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top