Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: need help with VBA code

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm trying to do some simple math with VBA, but it's not so simple to me. Here's what I have, what am I missing??

    Private Sub ADD_Click()
    Sheets("COLUMN").Activate
    LastRow = Range("A65536").End(xlUp).Offset(1, 0).Row
    FB = FB.Value
    FA = FA.Value
    CN = CN.Value
    CW = CW.Value
    CD = CD.Value
    VQ = VQ.Value
    BS = BS.Value
    TS = TS.Value
    TCOL = TCOL.Value
    BCOL = BCOL.Value
    B = B.Value
    C = C.Value
    D = D.Value
    H = H.Value
    K = K.Value
    O = O.Value
    FA = FB + 1
    Sheets("COLUMN").Range("A65536").End(xlUp).Offset(1, 0).Value = CN
    Sheets("COLUMN").Range("C65536").End(xlUp).Offset(1, 0).Value = FB
    Sheets("COLUMN").Range("E65536").End(xlUp).Offset(1, 0).Value = FA
    Sheets("COLUMN").Range("G65536").End(xlUp).Offset(1, 0).Value = CW
    Sheets("COLUMN").Range("I65536").End(xlUp).Offset(1, 0).Value = CD
    Sheets("COLUMN").Range("N65536").End(xlUp).Offset(1, 0).Value = VQ
    Sheets("COLUMN").Range("O65536").End(xlUp).Offset(1, 0).Value = BS
    Sheets("COLUMN").Range("L65536").End(xlUp).Offset(1, 0).Value = TCOL
    Sheets("COLUMN").Range("K65536").End(xlUp).Offset(1, 0).Value = BCOL
    Sheets("COLUMN").Range("Q65536").End(xlUp).Offset(1, 0).Value = B
    Sheets("COLUMN").Range("R65536").End(xlUp).Offset(1, 0).Value = C
    Sheets("COLUMN").Range("S65536").End(xlUp).Offset(1, 0).Value = D
    Sheets("COLUMN").Range("T65536").End(xlUp).Offset(1, 0).Value = H
    Sheets("COLUMN").Range("U65536").End(xlUp).Offset(1, 0).Value = K
    Sheets("COLUMN").Range("V65536").End(xlUp).Offset(1, 0).Value = R
    Sheets("COLUMN").Range("X65536").End(xlUp).Offset(1, 0).Value = TS
    BCOL = TCOL.Value
    FB = FA.Value
    FA = FB + 1
    TCOL = Focus
    End Sub

    Private Sub BS_Change()
    B.Value = BS.Column(2)
    C.Value = BS.Column(3)
    D.Value = BS.Column(4)
    H.Value = BS.Column(5)
    K.Value = BS.Column(6)
    O.Value = FA.Value - FB.Value - K.Value - 0.17
    End Sub

  2. #2
    New Member
    Join Date
    Feb 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry, I'm getting an error here ---->>

    O.Value = FA.Value - FB.Value - K.Value - 0.17
    End Sub

  3. #3
    Guest

    Default

    What error are you getting? Type mismatch?
    Check that all of the variables in the problem formula are numeric.

    What on earth are you trying to do anyway?

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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