Select range from active cell to copy to other sheet.

KyleJackMorrison

Board Regular
Joined
Dec 3, 2013
Messages
87
Hello,

I have a code that will activate in a set range where the words "complete" are changed. I would like the active cell to select that row, however only from columns B:AB. All i have found is how to select the entire row.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)If Intersect(Target, Range("Z3:Z602")) Is Nothing Then Exit Sub
If Target = "Completed" Then
    Target.Select
End If
'Select active row from B:AB
End Sub
TIA
 

MARK858

Well-known Member
Joined
Nov 12, 2010
Messages
11,329
Office Version
365, 2010
Platform
Windows, Mobile
Maybe...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("Z3:Z602")) Is Nothing And Target.Cells.Count = 1 Then
        Application.EnableEvents = False
        If Target = "Completed" Then Intersect(Target.EntireRow, Columns("B:AB")).Select
        Application.EnableEvents = True
    End If
End Sub
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
7,856
Office Version
2007
Platform
Windows
In the thread title you mention that you want to copy, perhaps the following will help you copy the row from B to AB on the "Master" sheet in the next empty row in column A.


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Not Intersect(Target, Range("Z3:Z602")) Is Nothing Then
    If Target.Count > 1 Then Exit Sub
    If Target.Value = "Completed" Then
      Range("B" & Target.Row & ":AB" & Target.Row).Copy Sheets("[COLOR=#0000ff]Master[/COLOR]").Range("A" & Rows.Count).End(xlUp)(2)
    End If
  End If
End Sub
 

Forum statistics

Threads
1,078,275
Messages
5,339,213
Members
399,286
Latest member
ossa

Some videos you may like

This Week's Hot Topics

Top