Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Moving a row from one sheet to another

Hi, I am trying to create a spreadsheet whereby the input of
information into a cell on a row will cause the data from that row to
be transferred to another sheet. The workbook I am creating is a log
for warehouse/ stock discrepancies. The first sheet will contain all
the discrepancies as they arise - with a column titled "resolved by"
where the person will enter their initials once they have resolved the
problem. As soon as this cell is completed, I want that entire row to
transferred to the next available row on a "resolved discrepancies"
sheet, and to be deleted from the first "discrepancies" sheet.

I hope this makes sense!

Any help would be much appreciated. I have some limited VBA knowledge
but this is beyond my capabilities!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Moving a row from one sheet to another

You would use the change event.

See Chip Pearson's site on events:

http://www.cpearson.com/excel/events.htm

You would need to put in an if statement to see if the change was to the
column for initials (assume column F)

Target holds a reference to the cell that triggered the change

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng as Range
if target.count 1 then exit sub
On Error goto ErrHandler
If target.column = 6 then ' is it column F
if not isempty(target) then ' has initials
Application.EnableEvents = False
' find row to copy to on sheet named DestSheet
set rng = worksheets("DestSheet") _
.Cells(rows.count,1).end(xlup)(2)
' do the copy
Target.entirerow.copy rng
' delete the row
Target.entireRow.Delete
end if
End if
Errhandler:
Application.EnableEvents = True
End Sub

You would right click on the sheet tab of the sheet containing the data
where the initials would be placed and select view code. then put in code
like the above in the resulting module.

Obviously you should test this rigorously on a copy of your workbook so you
don't destroy your data.

--
Regards,
Tom Ogilvy


"ell7" wrote:

Hi, I am trying to create a spreadsheet whereby the input of
information into a cell on a row will cause the data from that row to
be transferred to another sheet. The workbook I am creating is a log
for warehouse/ stock discrepancies. The first sheet will contain all
the discrepancies as they arise - with a column titled "resolved by"
where the person will enter their initials once they have resolved the
problem. As soon as this cell is completed, I want that entire row to
transferred to the next available row on a "resolved discrepancies"
sheet, and to be deleted from the first "discrepancies" sheet.

I hope this makes sense!

Any help would be much appreciated. I have some limited VBA knowledge
but this is beyond my capabilities!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Moving a row from one sheet to another

Absolutely brilliant - it works like a dream. Thank you so much!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Moving a row from one sheet to another

Absolutely brilliant - it works like a dream. Thank you so much!

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
formula for moving information from one sheet to another sheet Puzzled Excel Discussion (Misc queries) 4 June 6th 10 05:58 AM
moving from one sheet to another from a cell of a sheet mah1608 Excel Worksheet Functions 1 May 8th 09 06:27 AM
moving informatiion from one sheet to a total sheet john Excel Discussion (Misc queries) 2 January 31st 08 10:17 PM
moving around a sheet steve Excel Programming 3 September 19th 05 07:50 PM
Moving sheet Greg Excel Discussion (Misc queries) 2 June 30th 05 02:21 PM


All times are GMT +1. The time now is 10:39 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"