[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

copying into excel from excel

how can i read in values from a row and column  from another excel workbook and then paste them in my excel workbook?
i also need to know if i want to paste that value in the row and column i want.
0
bazukei
Asked:
bazukei
1 Solution
 
manchulaCommented:
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSecondBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim xlSecondSheet As Excel.Worksheet

Private Sub Command1_Click()
    xlSecondSheet.Cells(1, 5) = xlSheet.Cells(3, 1)
    'Give the row index and col index for Cells. Syntax Cells(RowIndex,ColIndex)

End Sub

Private Sub Form_Load()

Set xlApp = New Excel.Application
Set xlBook = GetObject("c:\temp\test.xls")
Set xlSheet = xlBook.Sheets(1)

Set xlSecondBook = GetObject("c:\temp\test1.xls")
Set xlSecondSheet = xlSecondBook.Sheets(1)

End Sub
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now