Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2018, 09:19 PM
Logit Logit is offline How to auto-populate data based on cell value Windows 10 How to auto-populate data based on cell value Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

.


Here is a macro method :

Code:
Option Explicit

Sub CopyYes()
    Dim c As Range
    Dim j As Integer
    Dim Source As Worksheet
    Dim sTarget As Worksheet

    ' Change worksheet designations as needed
    Set Source = ActiveWorkbook.Worksheets("Sheet2")
    Set sTarget = ActiveWorkbook.Worksheets("Sheet1")
    
    sTarget.Range("A3:B1000").Value = ""
    Application.ScreenUpdating = False
    j = 3     ' Start copying to row 1 in target sheet
    For Each c In Source.Range("A2:A1000")   ' Do 1000 rows
        If c = sTarget.Range("A2").Value Then
           Source.Rows(c.Row).Copy sTarget.Rows(j)
           j = j + 1
        End If
    Next c
    Application.ScreenUpdating = True
End Sub

Sub clrall()
Dim sTarget As Worksheet
Application.ScreenUpdating = False
    Set sTarget = ActiveWorkbook.Worksheets("Sheet1")
    sTarget.Range("A3:B1000").Value = ""
Application.ScreenUpdating = True
End Sub
Attached Files
File Type: xlsm AutoList.xlsm (19.3 KB, 10 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Auto Filter data based on Cell E1 text as Criteria? LearnerExcel Excel Programming 1 03-10-2018 01:36 PM
is sit possible to auto populate a cell based on dates wheddingsjr Excel 6 11-27-2017 11:21 AM
Auto enter data based on formula in another cell? RonLEngle Excel 5 06-30-2017 11:44 AM
Auto populate cell based on certain situations YW3 Excel 10 05-26-2017 02:02 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 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