Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jay95
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham
 
Posts: n/a
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
move from one column to another after a set condition BAZZA Excel Worksheet Functions 4 September 13th 05 12:45 PM
Move column to in-between existing columns Melissa Excel Discussion (Misc queries) 3 August 31st 05 01:43 PM
Running total w/2 columns - Excel Anna / Ideal Excel Worksheet Functions 14 August 10th 05 04:28 PM
How do I enter a negative dollar amount? CML Excel Discussion (Misc queries) 7 February 6th 05 11:19 PM


All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"