sorry for the title, that was my best way to try to explain in a short way !
Here is my problem:
1- On workbook1, I have created a Work order page and I want the Cell I2 to change number every time I open the file.
2- On workbook2, I have created a Sheet the will keep track of some information of Workbook1.
Cell: A8,I6,I8,A13,I2 (information are: Date, Customer, Engine, Serial, Problem, Work Order Number)
here is what I have done so far by finding some of my answer on forums (I never used macro before):
I almost work, the problem is that when saving on exiting it will save all the right informations that I want except the Work Order Number (cell I2); it is 1 number behind
Private Sub Workbook_Open()
Range("i2").Value = Range("i2").Value + 1
Dim sh1 As Worksheet, sh2 As Worksheet, v As Variant, i As Long, j As Long
Dim rw As Long
Set sh1 = Worksheets("W1")
Set sh2 = Worksheets("W2")
v = Array("A8", "E2", "I6", "I8", "A13", "I2")
i = 1
rw = sh2.Cells(Rows.Count, "A").End(xlUp).Row + 1
For j = LBound(v) To UBound(v)
sh1.Range(v(j)).copy sh2.Cells(rw, i)
i = i + 1
Next j
End Sub
Many thanks for your help
Which workbook is this code in? are you collecting I2 from the newly opened workbook in to the already open workbook?, if so you need to qualify your range properly. Some sample workbooks would be good.
can I send the file so you can have a look at it ?
It is in french but you would see how it work !
I have put the file lower in the post !
Last edited by martman; 03-12-2010 at 08:34 AM.
martman, please save your workbook as an xls (97-2003) as most people do not have 2007 yet, i'm at work and i do not have excel 2007 here![]()
here is the file saved in 97-2003 format !
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks