Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-15-2016, 09:44 AM
KunleExcel KunleExcel is offline Want to copy all rows that contain a specific value in column B Windows 8 Want to copy all rows that contain a specific value in column B Office 2010 32bit
Novice
 
Join Date: Jun 2016
Location: Nigeria
Posts: 17
KunleExcel is on a distinguished road
Default Copy List

Sub CopyList()

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Sheet1.Activate

Dim ListRange As Range
Set ListRange = Range("B3", Range("B3").End(xlDown))

ListRange.Cells(1, 1).Select

Dim i As Long

Do While ActiveCell <> ""
i = WorksheetFunction.CountIf(ListRange, ActiveCell.Value)
Range(ActiveCell, ActiveCell.Offset(i - 1, -1)).Copy
ActiveCell.Offset(i, 0).Select

Sheets.Add after:=Sheets(Worksheets.Count)
ActiveCell.PasteSpecial
On Error Resume Next
ActiveSheet.Name = Cells(1, 2).Value
Selection.EntireColumn.AutoFit

Sheet1.Activate
Loop

Range("A1").Select

Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Attached Files
File Type: xlsm CopyList.xlsm (19.7 KB, 9 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
If column B cell is a certain value then copy and paste the value to column A Snaybot Excel Programming 1 12-01-2015 07:10 PM
Copy column 1 data into Column 3 ShailShin Word VBA 1 06-18-2015 10:49 AM
Excel copy two numbers between specific column and paste in next sheet visha_1984 Excel 1 12-26-2014 07:59 PM
how can i split a column of rows in half without copy and paste.. Lindseyfparker Excel 2 04-25-2014 12:52 AM
Want to copy all rows that contain a specific value in column B Find specific rows then copy and paste to new doc konopca Word VBA 5 02-20-2014 02:34 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:44 PM.


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