+ Reply to Thread
Results 1 to 2 of 2

when I enter an amount in the A column move the row to another she

  1. #1
    Jay95
    Guest

    when I enter an amount in the A column move the row to another she

    When I enter an amount into the A column, move a group of cells in that row
    to another sheet in Excel.

  2. #2
    JLatham
    Guest

    RE: when I enter an amount in the A column move the row to another she

    Put this code into the worksheet's code section - not the workbook or a
    general module. I set up variables so you can provide the name of the sheet
    that the information is to be copied to and specify the columns in the row to
    be copied.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim SourceSheetName As String
    Dim DestinationSheetName As String
    Dim StartColumnForCopy As String
    Dim EndColumnForCopy As String
    Dim AnyRange As String

    SourceSheetName = ActiveSheet.Name ' save this sheet name

    'change as needed
    DestinationSheetName = "Sheet2" ' change as required
    StartColumnForCopy = "B"
    EndColumnForCopy = "E"
    'end of user needed changes

    If Target.Column <> 1 Then ' was not in column A
    Application.EnableEvents = True
    Exit Sub
    End If
    Application.EnableEvents = False
    Application.ScreenUpdating = False
    AnyRange = StartColumnForCopy & Target.Row & ":" _
    & EndColumnForCopy & Target.Row
    Range(AnyRange).Select
    Selection.Copy
    ThisWorkbook.Sheets(DestinationSheetName).Activate
    ActiveSheet.Range(AnyRange).Select
    ActiveSheet.Paste
    Sheets(SourceSheetName).Select
    Range(Target.Address).Select
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    End Sub

    "Jay95" wrote:

    > When I enter an amount into the A column, move a group of cells in that row
    > to another sheet in Excel.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1