Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Beginners help

This should work for you. You may have to customize this code to fit your
specification like Sheet names or ranges you wish to cut and paste. You will
have to insert a Command Button in a worksheet. The assign this macro to the
command button.

Sub MoveInvoice()

Const shOld As String = "Sheet1"
Const shNew As String = "Sheet1"
Dim LastRow As Long
Dim Invoices As Range
Dim cell As Range
Dim OldRange As Range
Dim NewRange As Range

'finds last used row in Col. E
LastRow = Sheets(shOld).Cells(Rows.Count, 5).End(xlUp).Row

'column E contains invoice numbers
Set Invoices = Sheets(shOld).Range("E1:E" & LastRow)

'cuts Invoice Name and pastes in Col. P
For Each cell In Invoices
'invoice name
Set OldRange = Sheets(shOld).Range(Cells(cell.Row, 6),
Cells(cell.Row, 6))
'new invoice name location
Set NewRange = Sheets(shNew).Range(Cells(cell.Row, 16),
Cells(cell.Row, 16))
'cut and paste
OldRange.Cut Destination:=NewRange
Next cell

End Sub

Hope this helps! If so, please click "Yes" below.
--
Cheers,
Ryan


"bgkgmg" wrote:

Trying to use the command click button. Cell O2 has the invoice number 101,
O3 is 102, O4 is 103 etc. When I put an invoice number in cell E2 (101) and
the invoice name in F2, I would like to click on the button (Submit) and
advance the invoice name to P2. I know I can use the IF formula in Excel but
there is a lot more info that I would like to move with it and all at the
same time.
Thanks

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
Beginners Question GordyB Excel Discussion (Misc queries) 3 February 1st 10 10:33 PM
beginners help... Daniela Excel Worksheet Functions 2 May 1st 08 11:35 PM
how to set up spreadsheet for beginners logeo Setting up and Configuration of Excel 1 September 5th 06 05:49 PM
Maybe this will help a lot of beginners like myself Need help with sumif Excel Discussion (Misc queries) 2 January 26th 06 04:09 AM
More Beginners help! juliekerin Excel Programming 5 September 17th 04 01:10 PM


All times are GMT +1. The time now is 05:09 PM.

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

About Us

"It's about Microsoft Excel"