Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2016, 06:33 AM
rsrasc rsrasc is offline Copying Same Value Between Two Cells Windows 10 Copying Same Value Between Two Cells Office 2013
Competent Performer
Copying Same Value Between Two Cells
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default Copying Same Value Between Two Cells

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!
Attached Files
File Type: xlsm TB Info-ExcelForum.xlsm (116.2 KB, 8 views)
Reply With Quote
  #2  
Old 02-28-2016, 05:59 PM
skywriter skywriter is offline Copying Same Value Between Two Cells Windows 7 32bit Copying Same Value Between Two Cells Office 2010 32bit
Novice
 
Join Date: Apr 2015
Posts: 5
skywriter is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 02-29-2016, 02:27 AM
rsrasc rsrasc is offline Copying Same Value Between Two Cells Windows 10 Copying Same Value Between Two Cells Office 2013
Competent Performer
Copying Same Value Between Two Cells
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Hello Skywriter,

Thank you for taking the time to help me with the code. Is working great...

I appreciate it.

Cheers!
Reply With Quote
  #4  
Old 02-29-2016, 10:53 PM
skywriter skywriter is offline Copying Same Value Between Two Cells Windows 7 32bit Copying Same Value Between Two Cells Office 2010 32bit
Novice
 
Join Date: Apr 2015
Posts: 5
skywriter is on a distinguished road
Default

My pleasure, thanks for the feedback.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Same Value Between Two Cells 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 Same Value Between Two Cells Copying cells isminoh Excel 5 04-18-2012 11:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft