Results 1 to 4 of 4

Thread: Using selecting in Excel

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Dear VB users,

    In my VB program I want to select in an opened Excel sheet a part of the sheet.

    After the selecting the program must know what the selecting was.

    How do I do that?

    Knows somebody an answer?

    Nice greetings,

    Michelle.

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226

    Post

    Hi michelle.

    Do you want to know how to open the XL object?
    Also, you said "program must know what the selecting was"!, You mean the cell.values?

    Please clarify with an example.

    Good Luck.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Hello Lyla,

    I will simple explain my question:

    On my form there are two command buttons

    Button 1:
    Private Sub CmdOpenExel_Click()
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Open ("c:\q.xls")
    End Sub

    With button-1 I can open the spread sheet.

    With the Alt Tab key I go to the sheet and select a part of the sheet.

    With the Alt Tab key I return to the form.

    With button-2 I want to know what is selected in the sheet.

    I hope you can help me.

    Nice regards, Michelle.

  4. #4
    Lively Member
    Join Date
    Jul 1999
    Posts
    78

    Post

    I'm still foggy on what you need to know regarding your second button....

    do you want to know what range is selected in the application, or do you want the values in the range?

    Either way, look into the Range Object. I can't remember if a user selected range returns a value, but that will set you up a little further.



    [This message has been edited by JohnAtWork (edited 01-27-2000).]

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