Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, Sure this is a relatively simple one but i'm having trouble (i blame the night befores alcohol intake). I want to send this info to a workbook called "sales" in the c:\ drive into a sheet called "sales". What is the correct way to reference this in the code below:- Sheets("INVOICE").Select Dim lrw As Long, cl As Long lrw = Sheets("sales").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Row Sheets("sales").Cells(lrw, 1) = Sheets("invoice").Range("F3") Sheets("Sales").Cells(lrw, 2) = Sheets("invoice").Range("M5") Thanks in advance as usual. Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=533008 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim lrw As Long, cl As Long
Dim sh as Worksheet, sh1 as Worksheet Dim bk as Workbook set sh = Thisworkbook.Worksheets("Invoice") On error resume next set bk = Workbooks("Sales.xls") On error goto 0 if bk is nothing then _ set bk = worbooks.open("C:\sales.xls") set sh1 = bk.worksheets("Sales") lrw = sh1.Cells(Rows.Count, "A").End(xlUp).Offset(1,0).Row sh1.Cells(lrw, 1).Value = sh.Range("F3").Value sh1.Cells(lrw, 2).Value = sh.Range("M5").Value -- Regards, Tom Ogilvy "chris100" wrote: Hi all, Sure this is a relatively simple one but i'm having trouble (i blame the night befores alcohol intake). I want to send this info to a workbook called "sales" in the c:\ drive into a sheet called "sales". What is the correct way to reference this in the code below:- Sheets("INVOICE").Select Dim lrw As Long, cl As Long lrw = Sheets("sales").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Row Sheets("sales").Cells(lrw, 1) = Sheets("invoice").Range("F3") Sheets("Sales").Cells(lrw, 2) = Sheets("invoice").Range("M5") Thanks in advance as usual. Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=533008 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing other workbook. | Excel Worksheet Functions | |||
workbook referencing - how to! | Excel Programming | |||
Referencing a different Workbook | Excel Worksheet Functions | |||
referencing another workbook | Excel Programming | |||
Referencing one workbook in other??? | Excel Programming |