Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Assistance Required....

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
What's up VBA Experts, I need your help.
Question:
I need to know the proper syntax to code a Label in excel. let me explain myself a bit better. See sample below:

I need to increment the numbers in B1 & B2 based on what's typed in cell A1. I have no problem doing it in excel but I don't know how to apply the proper coding to a VBA label. Thanks in advance and hope I'm being clear..

Field Length From To
A1 B1 B2
50 1 50
10 51 60

This is the code I use in excel
=SUM(A1:B2) - 1 and down as many as I need.

"The reward of one duty done is the power to fulfill another"
<%
Jr_Clown@Yahoo.com
%>
 
Not sure what you mean by 'label', but it's easy enough to put formulas into cells using VBA, e.g.
range(&quot;C2&quot;).formula=&quot;=SUM(A2:B2)-1&quot;
Or if you want the calculation to be done within VBA, use a few variables to store the intermediate and final results,
and then put the results into the worksheet by assigning the variable to a range, i.e.
range(&quot;C2&quot;)=dblTheResult

If that doesn't help, please restate your problem for us!
Cheers
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top