• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

New to excel need a formula

Ashley.Powell

New Member
I am in need of some assistance. I am wanting to move rows from one sheet to another based on a condition. For instance if column B says West, I want it to also copy this row to sheet 3 labeled West Community, If column B5 says East, I want it to also copy this row to Sheet 2 labeled East Community. I am a beginner user in Excel and need help please. TIA!
upload_2016-4-21_15-41-27.png
 
Last edited:
Hello,
If I am understanding your question you looking for a keyword move script and based on the key work you want the row to be moved to a sheet with name of the sheet matching the key word. If that is the case.. I think this script will work for you. I can not take credit for this script.. I had a similar request in the past and a member helped me.

Code:
Sub MOVEROW()

  Dim Sentences
  Dim Word As String
  Dim i As Long
  Dim iWordPos As Integer
  Dim lRow As Long
  Dim sWord As String
  
  sWord = InputBox("Enter search string.")
  If sWord = "" Then Exit Sub
  Worksheets.Add.Name = sWord
  Sentences = Range("A1", Range("A65536").End(xlUp))
  lRow = 0
  For i = 1 To Range("A1").End(xlDown).Row
  iWordPos = InStr(LCase(Sentences(i, 1)), LCase(sWord))
  If iWordPos > 0 Then
  lRow = lRow + 1
  ActiveSheet.Cells(lRow, 1) = Sentences(i, 1)
  End If
  Next i
End Sub
 
Its hard to offer a real solution without being able to see the Excel file, but I suggest you keep data in a single table and report off by using filters/slicers or pivots. Whenever you have blank rows in a table it suggests that what you have is more akin to a document than a data-set that can be manipulated in any structured fashion.

Beware of copying data from one sheet to another - any changes to one will not be reflected in the other.
 
Back
Top