Code needed to auto populate cells on another worksheet

Msears

Board Regular
Joined
Apr 14, 2022
Messages
56
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
Hello All, I am in need to a code to do this: I have data on a worksheet called "Data Entry" It consists of Columns B:M. I want it to find a word, for instance "Group Skills" in Col C, when found auto populate on worksheet "Group Skills, in Columns A:L, starting with line 2. New data is entered line by line upon update. Is this possible? Thanks in advance!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
paste into module, run: FindGroupSkill

Code:
Sub FindGroupSkill()
Dim wsSrc As Worksheet, wsTarg As Worksheet
Dim vSkill2Find, vSkill
Dim r As Long
Sheets("Data Entry").Activate
Set wsSrc = ActiveSheet
Sheets("Group Skills").Select
Set wsTarg = ActiveSheet
ClearTheCells
wsSrc.Activate
Range("A2").Activate
vSkill2Find = InputBox("Enter Skill to find", "Find Group skill")
If vSkill2Find = "" Then Exit Sub
While ActiveCell.Value <> ""
   vSkill = ActiveCell.Offset(0, 2).Value
   If LCase(vSkill) = LCase(vSkill2Find) Then
      r = ActiveCell.Row
      Rows(r & ":" & r).Copy
      wsTarg.Activate
      ActiveSheet.Paste
      Application.CutCopyMode = False
      ActiveCell.Offset(1, 0).Select 'next row
     
      wsSrc.Activate
   End If
   
   ActiveCell.Offset(1, 0).Select 'next row
Wend
wsTarg.Activate
MsgBox "Done"
Set wsSrc = Nothing
Set wsTarg = Nothing
End Sub


Private Sub ClearTheCells()
    Range("A2:M500").ClearContents
    Range("A2").Activate
End Sub
 
Upvote 0
Hello Ranman 256. I copied the code above in the tab called "Group Skills". When I enter data into "Data Entry" Tab is doesn't populate in "Group Skills" Can you explain the purpose of the "Clear The Cells"?
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,228
Members
453,025
Latest member
Hannah_Pham93

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