CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    5

    What Do the Numbers stand for?

    Can someone please review the code below and tell me what the (0, 1), (0, 2) and so on stands for within it i.e., is this in relation to the cell in the excel worksheet the answer should be placed or am I way off?

    Thanks



    Private Sub cmdOK_Click()

    ActiveWorkbook.Sheets("Course Bookings").Activate

    Range("A1").Select

    Do

    If IsEmpty(ActiveCell) = FalseThen

    ActiveCell.Offset(1, 0).Select

    End If

    Loop Until IsEmpty(ActiveCell) = True

    ActiveCell.Value = txtName.Value

    ActiveCell.Offset(0, 1) = txtPhone.Value

    ActiveCell.Offset(0, 2) = cboDepartment.Value

    ActiveCell.Offset(0, 3) = cboCourse.Value

    If optIntroduction = True Then

    ActiveCell.Offset(0, 4).Value = "Intro"

    ElseIf optIntermediate = True Then

    ActiveCell.Offset(0, 4).Value = "Intermed"

    Else

    ActiveCell.Offset(0, 4).Value = "Adv"

    End If

    If chkLunch = True Then

    ActiveCell.Offset(0, 5).Value = "Yes"

    Else

    ActiveCell.Offset(0, 5).Value = "No"

    End If

  2. #2
    Join Date
    Oct 2006
    Posts
    327

    Re: What Do the Numbers stand for?

    Hello,

    That's VBA (not VB6) code.
    Example :
    Offset(0, 1) refers to the cell which, on the same Line (0), is located 5 columns further.

  3. #3
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: What Do the Numbers stand for?

    Except that should be Offset(0, 5). Isn't it, moa?

  4. #4
    Join Date
    Oct 2006
    Posts
    327

    Re: What Do the Numbers stand for?

    Hello, Wof :
    Of course (I don't know wether my fingers are too thick or my eyes too small)...

  5. #5
    Join Date
    Jan 2010
    Posts
    5

    Re: What Do the Numbers stand for?

    Sorry that I am in the wrong forum!! My brains are just being fried with teaching myself this stuff. I will get out and find the right one, but thank you for your help, it was very much appreciated.

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

Featured