need help with VBA code

Mark Lowe

New Member
Joined
Feb 17, 2002
Messages
8
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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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?
 
Upvote 0

Forum statistics

Threads
1,214,387
Messages
6,119,208
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top