Results 1 to 2 of 2

Thread: Excel Sheets and VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    17

    Excel Sheets and VB

    I have activated the worksheet that i am trying to get to in Excel. However, VB will recognize the default worksheet and will not read any values from the activated worksheet. All the worksheets are located in the same workbook. Code is as below:

    Workbooks(lateruse).Sheets(excelinfo3).Activate
    'Later Use is the C:/ Filename** 'EXCELINFO3 is the SHEET NAME'
    ActiveWorkbook.Worksheets(excelinfo3).Activate

    'EXAMPLE DO FOR LOOP TO SEE IF VB SEES NEW SHEET
    Do Until InStr(Excel1.Cells(row, col), "Group")
    a = Excel1.Cells(col, row).Value
    row = row + 1
    Loop
    'EXCEL RETURNS DEFAULT SHEET VALUES

    HELP!!

    Thanks in advance!!
    ~Jason

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    VB Code:
    1. 'PURPOSE: This will Open myfile.xls, and the particular worksheet
    2.   appExcel.Workbooks.Open FileName:="C:\myfolder\myfile.xls"
    3.   appExcel.Worksheets("pSheet").Select
    4. 'PURPOSE: This will send data to a particular Range
    5.   appExcel.Range("A4").Value = "help me"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width