![]() |
|
|
|
#1
|
|||
|
|||
|
Hi all,
See attachment. I have the following information in Column B, in cell B5 Account: NF-000-11101 and the same info in cell B10: Account: NF-000-11101 Therefore, cells B6 thru B9 are empty. Same thing goes for the following information for cell B11 and cell B25 Account: NF-000-11103 Therefore, cells B12 thru B24 are empty. Basically, what I need is a macro that will copy or fill the same values between the two same values. See Column C for end results. If done I would like to see the final results in Column B. This file has 6,323 rows of info in column A and B. Thank you in advance for your support and cooperation. Cheers! |
|
#2
|
|||
|
|||
|
Try this on your example sheet.
Code:
Sub FillIn()
Dim ws As Worksheet, lr As Long, rngData As Range, r As Range
Set ws = Worksheets("DetailedTBFY15")
Application.ScreenUpdating = False
With ws
lr = .Cells(Rows.Count, "B").End(xlUp).row
Set rngData = .Range("B5:B" & lr)
End With
With rngData.SpecialCells(4)
For Each r In .Areas
r.Value = r(0).Value
Next r
End With
Application.ScreenUpdating = True
End Sub
|
|
#3
|
|||
|
|||
|
Hello Skywriter,
Thank you for taking the time to help me with the code. Is working great... I appreciate it. Cheers! |
|
#4
|
|||
|
|||
|
My pleasure, thanks for the feedback.
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Copying text into multiple cells at once
|
BIMwit | Word Tables | 1 | 05-14-2015 09:50 PM |
| Copying specific cells to a new sheets also give sheetname | dapeamel | Excel | 0 | 02-24-2015 09:20 AM |
| Copying text range of cells to different cells adds an extra line | jpb103 | Word VBA | 2 | 07-23-2014 12:22 PM |
| Copying a formula that uses pivottable cells | Paul46 | Excel | 0 | 02-08-2014 07:04 AM |
Copying cells
|
isminoh | Excel | 5 | 04-18-2012 11:49 AM |