LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to improve this code?

Hi,

I save all the data of each invoice in one row of my DATA sheet. Belo
is my sub doing that. In fact, it is much bigger, I truncated it a bi
in this example.

I offset one column for each individual data of the invoice.

I suspect that:

ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("L12")

is not the ultimate way of doing it. But it is working fine. I jus
want to improve my coding as much as I can.

Any suggestions?

Thanks!

Alain



Sub Save_And_New_Invoice()
Dim Line
Application.ScreenUpdating = False
Sheets("Data").Visible = True
Sheets("Data").Select
Line = LastLine(Sheets("Data"))

Range("A1").Select
ActiveCell.Offset(Line, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("L6")
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("L12")
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("E12")
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("E13")
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = Sheets("invoice").Range("E14")

Range("A1").Select
Sheets("Invoice").Select
ActiveWorkbook.Save
Sheets("Data").Visible = False
Application.ScreenUpdating = True
Application.Run "New_Invoice"
End Su

--
Message posted from http://www.ExcelForum.com

 
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
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
How can I set the tab to improve navigation in Excel? stefanie Setting up and Configuration of Excel 1 November 9th 05 07:32 PM
Help improve mySchedule Please StevenPar Excel Discussion (Misc queries) 0 October 23rd 05 06:29 AM
How can improve this formula? Metallo Excel Worksheet Functions 7 January 27th 05 05:49 PM
Need to improve a formula Brian Excel Worksheet Functions 2 December 9th 04 07:17 PM


All times are GMT +1. The time now is 08:36 AM.

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"