LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
kmf kmf is offline
external usenet poster
 
Posts: 5
Default visual basic

I am using excel spreadsheets to build a account system for a business. I
want to enter sales data each week onto a spreadsheet and have it
automatically entered onto a invoice on a separate sheet. I have used this
vis basic code to do that:Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "AP4" Then
Worksheets("$INV1").Range("$A$22").Value = _
Target.Value
End If
If Target.Address = "AP5" Then
Worksheets("$INV1").Range("$A$23").Value = _
Target.Value
since I have to repeat this many times because there are fifty two weeks in
a year, does someone know how I can repeat the code and have it change cells
automatically so i do not have to code every cell, justas excel works when
you copy from cell to cell it adjusts the cell address. thanks for any help

KMF
 
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
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
New to Visual Basic Need help with sumif Excel Discussion (Misc queries) 3 November 11th 08 07:46 PM
visual basic Matthew Excel Discussion (Misc queries) 4 October 10th 07 01:28 PM
Visual Basic Co-op 20 Excel Discussion (Misc queries) 2 June 28th 07 09:06 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM


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