code to sum 8 textboxes

Hi there,
I am trying to get a text box (txtsubtotal) to sum 8 other 'price' text 
boxes (txtprice1...txtprice8) when a command button (cmdCalculate) is 
clicked. Each 'price' text box is filled via a combo box (cboitem1) change 
code.
Here is briefly what I have:

Each combo box is coded like this:
Private Sub cboItem1_change()
Me.txtprice1 = WorksheetFunction.VLookup(Me.cboItem1, Worksheets 
_("Pizzas").Range("A:B"), 2, 0)
End Sub

Each 'price' text box is coded like this:
Private Sub txtprice1_change()
txtprice1.Value = Format(Me.txtprice1.Value, "$#,##0.00")
End Sub

And the command button click is:
Private Sub cmdCalculate_Click()
If IsNumeric(Me.txtprice1.Value) _
 And IsNumeric(Me.txtprice2.Value) _
 And IsNumeric(Me.txtprice3.Value) _
 And IsNumeric(Me.txtprice4.Value) _
 And IsNumeric(Me.txtprice5.Value) _
 And IsNumeric(Me.txtprice6.Value) _
 And IsNumeric(Me.txtprice7.Value) _
 And IsNumeric(Me.txtprice8.Value) Then
   Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
                               + CDbl(Me.txtprice2.Value) _
                               + CDbl(Me.txtprice3.Value) _
                               + CDbl(Me.txtprice4.Value) _
                               + CDbl(Me.txtprice5.Value) _
                               + CDbl(Me.txtprice6.Value) _
                               + CDbl(Me.txtprice6.Value) _
                               + CDbl(Me.txtprice7.Value) _
                               + CDbl(Me.txtprice8.Value)
End If
End Sub

However it seems to work only sometimes. At the moment when I click 
cmdCalculate when the form is 'live' nothing happens at all. It has worked 
before though. It seems when I get a run-time error on any different 
unrelated code it stuffs this one up.

What am I missing?

Thanks in advance :)
0
Utf
11/16/2009 12:59:02 PM
excel.programming 6508 articles. 2 followers. Follow

5 Replies
788 Views

Similar Articles

[PageSpeed] 28

Try these changes.  I added Trim() method and added a message box to
indicate when the data is not numeric to help isolate the problem.

Private Sub cmdCalculate_Click()
If IsNumeric(Trim(Me.txtprice1.Value)) _
And TrimIsNumeric(Me.txtprice2.Value)) _
And TrimIsNumeric(Me.txtprice3.Value)) _
And Trim(IsNumeric(Me.txtprice4.Value)) _
And Trim(IsNumeric(Me.txtprice5.Value)) _
And Trim(IsNumeric(Me.txtprice6.Value)) _
And Trim(IsNumeric(Me.txtprice7.Value)) _
And Trim(IsNumeric(Me.txtprice8.Value)) Then
Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
+ CDbl(Trim(Me.txtprice2.Value)) _
+ CDbl(Trim(Me.txtprice3.Value)) _
+ CDbl(Trim(Me.txtprice4.Value)) _
+ CDbl(Trim(Me.txtprice5.Value)) _
+ CDbl(Trim(Me.txtprice6.Value)) _
+ CDbl(Trim(Me.txtprice6.Value)) _
+ CDbl(Trim(Me.txtprice7.Value)) _
+ CDbl(Trim(Me.txtprice8.Value))
Else
msgbox("Amounts are not Numbers")
End If
End Sub


-- 
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=154415

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
joel
11/16/2009 1:07:57 PM
Try these changes. I added Trim() method and added a message box to indicate 
when the data is not numeric to help isolate the problem.

Private Sub cmdCalculate_Click()
If IsNumeric(Trim(Me.txtprice1.Value)) _
And TrimIsNumeric(Me.txtprice2.Value)) _
And TrimIsNumeric(Me.txtprice3.Value)) _
And Trim(IsNumeric(Me.txtprice4.Value)) _
And Trim(IsNumeric(Me.txtprice5.Value)) _
And Trim(IsNumeric(Me.txtprice6.Value)) _
And Trim(IsNumeric(Me.txtprice7.Value)) _
And Trim(IsNumeric(Me.txtprice8.Value)) Then
Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
+ CDbl(Trim(Me.txtprice2.Value)) _
+ CDbl(Trim(Me.txtprice3.Value)) _
+ CDbl(Trim(Me.txtprice4.Value)) _
Original Source: The Code Cage Forums 
http://www.thecodecage.com/forumz/excel-vba-programming/154415-code-sum-8-textboxes.html#post559813
+ CDbl(Trim(Me.txtprice5.Value)) _
+ CDbl(Trim(Me.txtprice6.Value)) _
+ CDbl(Trim(Me.txtprice6.Value)) _
+ CDbl(Trim(Me.txtprice7.Value)) _
+ CDbl(Trim(Me.txtprice8.Value))
Else
msgbox("Amounts are not Numbers")
End If
End Sub 


"Rachel" wrote:

> Hi there,
> I am trying to get a text box (txtsubtotal) to sum 8 other 'price' text 
> boxes (txtprice1...txtprice8) when a command button (cmdCalculate) is 
> clicked. Each 'price' text box is filled via a combo box (cboitem1) change 
> code.
> Here is briefly what I have:
> 
> Each combo box is coded like this:
> Private Sub cboItem1_change()
> Me.txtprice1 = WorksheetFunction.VLookup(Me.cboItem1, Worksheets 
> _("Pizzas").Range("A:B"), 2, 0)
> End Sub
> 
> Each 'price' text box is coded like this:
> Private Sub txtprice1_change()
> txtprice1.Value = Format(Me.txtprice1.Value, "$#,##0.00")
> End Sub
> 
> And the command button click is:
> Private Sub cmdCalculate_Click()
> If IsNumeric(Me.txtprice1.Value) _
>  And IsNumeric(Me.txtprice2.Value) _
>  And IsNumeric(Me.txtprice3.Value) _
>  And IsNumeric(Me.txtprice4.Value) _
>  And IsNumeric(Me.txtprice5.Value) _
>  And IsNumeric(Me.txtprice6.Value) _
>  And IsNumeric(Me.txtprice7.Value) _
>  And IsNumeric(Me.txtprice8.Value) Then
>    Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
>                                + CDbl(Me.txtprice2.Value) _
>                                + CDbl(Me.txtprice3.Value) _
>                                + CDbl(Me.txtprice4.Value) _
>                                + CDbl(Me.txtprice5.Value) _
>                                + CDbl(Me.txtprice6.Value) _
>                                + CDbl(Me.txtprice6.Value) _
>                                + CDbl(Me.txtprice7.Value) _
>                                + CDbl(Me.txtprice8.Value)
> End If
> End Sub
> 
> However it seems to work only sometimes. At the moment when I click 
> cmdCalculate when the form is 'live' nothing happens at all. It has worked 
> before though. It seems when I get a run-time error on any different 
> unrelated code it stuffs this one up.
> 
> What am I missing?
> 
> Thanks in advance :)
0
Utf
11/16/2009 1:25:02 PM
Try this

Private Sub cmdCalculate_Click()
Dim txt As Control
X =3D 0
   For Each txt In Me.Controls
      If TypeName(txt) =3D "TextBox" Then
              If txt.Value <> "" Then Y =3D CInt(txt.Value) + Y
            X =3D X + 1
        End If
      If X =3D 2 Then Exit For
   Next txt
Me.txtSubTotal.Value =3D Y
End Sub

On Nov 16, 5:59=A0pm, Rachel <Rac...@discussions.microsoft.com> wrote:
> Hi there,
> I am trying to get a text box (txtsubtotal) to sum 8 other 'price' text
> boxes (txtprice1...txtprice8) when a command button (cmdCalculate) is
> clicked. Each 'price' text box is filled via a combo box (cboitem1) chang=
e
> code.
> Here is briefly what I have:
>
> Each combo box is coded like this:
> Private Sub cboItem1_change()
> Me.txtprice1 =3D WorksheetFunction.VLookup(Me.cboItem1, Worksheets
> _("Pizzas").Range("A:B"), 2, 0)
> End Sub
>
> Each 'price' text box is coded like this:
> Private Sub txtprice1_change()
> txtprice1.Value =3D Format(Me.txtprice1.Value, "$#,##0.00")
> End Sub
>
> And the command button click is:
> Private Sub cmdCalculate_Click()
> If IsNumeric(Me.txtprice1.Value) _
> =A0And IsNumeric(Me.txtprice2.Value) _
> =A0And IsNumeric(Me.txtprice3.Value) _
> =A0And IsNumeric(Me.txtprice4.Value) _
> =A0And IsNumeric(Me.txtprice5.Value) _
> =A0And IsNumeric(Me.txtprice6.Value) _
> =A0And IsNumeric(Me.txtprice7.Value) _
> =A0And IsNumeric(Me.txtprice8.Value) Then
> =A0 =A0Me.txtSubTotal.Value =3D CDbl(Me.txtprice1.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice2.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice3.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice4.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice5.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice6.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice6.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice7.Value) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+ CDbl(Me.=
txtprice8.Value)
> End If
> End Sub
>
> However it seems to work only sometimes. At the moment when I click
> cmdCalculate when the form is 'live' nothing happens at all. It has worke=
d
> before though. It seems when I get a run-time error on any different
> unrelated code it stuffs this one up.
>
> What am I missing?
>
> Thanks in advance :)

0
muddan
11/16/2009 1:43:10 PM
Excellent  Joel, seems to be working perfectly. 
One little change, not all the text boxes will need to be completed all the 
time eg only txtprice1 through txtprice4 may be completed if there are only 4 
items. At the moment the cmdcalculate won't calculate because the empty cells 
aren't a number (msgbox appears). 
Is it possible to allow them to be blank?
I have also tried a different work around where in userform_initialise I 
have set the value of these txtboxes to "$0.00" which then allows the 
calculation however this will also then be transferred to the worksheet with 
cmdAdd which is just going to get really messy......

Thanks a million for you prompt help :)

"Joel" wrote:

> Try these changes. I added Trim() method and added a message box to indicate 
> when the data is not numeric to help isolate the problem.
> 
> Private Sub cmdCalculate_Click()
> If IsNumeric(Trim(Me.txtprice1.Value)) _
> And TrimIsNumeric(Me.txtprice2.Value)) _
> And TrimIsNumeric(Me.txtprice3.Value)) _
> And Trim(IsNumeric(Me.txtprice4.Value)) _
> And Trim(IsNumeric(Me.txtprice5.Value)) _
> And Trim(IsNumeric(Me.txtprice6.Value)) _
> And Trim(IsNumeric(Me.txtprice7.Value)) _
> And Trim(IsNumeric(Me.txtprice8.Value)) Then
> Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
> + CDbl(Trim(Me.txtprice2.Value)) _
> + CDbl(Trim(Me.txtprice3.Value)) _
> + CDbl(Trim(Me.txtprice4.Value)) _
> Original Source: The Code Cage Forums 
> http://www.thecodecage.com/forumz/excel-vba-programming/154415-code-sum-8-textboxes.html#post559813
> + CDbl(Trim(Me.txtprice5.Value)) _
> + CDbl(Trim(Me.txtprice6.Value)) _
> + CDbl(Trim(Me.txtprice6.Value)) _
> + CDbl(Trim(Me.txtprice7.Value)) _
> + CDbl(Trim(Me.txtprice8.Value))
> Else
> msgbox("Amounts are not Numbers")
> End If
> End Sub 
> 
> 
> "Rachel" wrote:
> 
> > Hi there,
> > I am trying to get a text box (txtsubtotal) to sum 8 other 'price' text 
> > boxes (txtprice1...txtprice8) when a command button (cmdCalculate) is 
> > clicked. Each 'price' text box is filled via a combo box (cboitem1) change 
> > code.
> > Here is briefly what I have:
> > 
> > Each combo box is coded like this:
> > Private Sub cboItem1_change()
> > Me.txtprice1 = WorksheetFunction.VLookup(Me.cboItem1, Worksheets 
> > _("Pizzas").Range("A:B"), 2, 0)
> > End Sub
> > 
> > Each 'price' text box is coded like this:
> > Private Sub txtprice1_change()
> > txtprice1.Value = Format(Me.txtprice1.Value, "$#,##0.00")
> > End Sub
> > 
> > And the command button click is:
> > Private Sub cmdCalculate_Click()
> > If IsNumeric(Me.txtprice1.Value) _
> >  And IsNumeric(Me.txtprice2.Value) _
> >  And IsNumeric(Me.txtprice3.Value) _
> >  And IsNumeric(Me.txtprice4.Value) _
> >  And IsNumeric(Me.txtprice5.Value) _
> >  And IsNumeric(Me.txtprice6.Value) _
> >  And IsNumeric(Me.txtprice7.Value) _
> >  And IsNumeric(Me.txtprice8.Value) Then
> >    Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
> >                                + CDbl(Me.txtprice2.Value) _
> >                                + CDbl(Me.txtprice3.Value) _
> >                                + CDbl(Me.txtprice4.Value) _
> >                                + CDbl(Me.txtprice5.Value) _
> >                                + CDbl(Me.txtprice6.Value) _
> >                                + CDbl(Me.txtprice6.Value) _
> >                                + CDbl(Me.txtprice7.Value) _
> >                                + CDbl(Me.txtprice8.Value)
> > End If
> > End Sub
> > 
> > However it seems to work only sometimes. At the moment when I click 
> > cmdCalculate when the form is 'live' nothing happens at all. It has worked 
> > before though. It seems when I get a run-time error on any different 
> > unrelated code it stuffs this one up.
> > 
> > What am I missing?
> > 
> > Thanks in advance :)
0
Utf
11/16/2009 1:50:01 PM
Try this

Private Sub cmdCalculate_Click()

Dim MyTotal As Double
MyTotal = 0
If IsNumeric(Trim(Me.txtprice1.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice1.Value)
End If
If IsNumeric(Trim(Me.txtprice2.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice2.Value)
End If
If IsNumeric(Trim(Me.txtprice3.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice3.Value)
End If
If IsNumeric(Trim(Me.txtprice4.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice4.Value)
End If
If IsNumeric(Trim(Me.txtprice5.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice5.Value)
End If
If IsNumeric(Trim(Me.txtprice6.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice6.Value)
End If
If IsNumeric(Trim(Me.txtprice7.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice7.Value)
End If
If IsNumeric(Trim(Me.txtprice8.Value)) Then
   MyTotal = MyTotal + Trim(Me.txtprice8.Value)
End If

Me.txtSubTotal.Value = MyTotal

End Sub





"Rachel" wrote:

> Excellent  Joel, seems to be working perfectly. 
> One little change, not all the text boxes will need to be completed all the 
> time eg only txtprice1 through txtprice4 may be completed if there are only 4 
> items. At the moment the cmdcalculate won't calculate because the empty cells 
> aren't a number (msgbox appears). 
> Is it possible to allow them to be blank?
> I have also tried a different work around where in userform_initialise I 
> have set the value of these txtboxes to "$0.00" which then allows the 
> calculation however this will also then be transferred to the worksheet with 
> cmdAdd which is just going to get really messy......
> 
> Thanks a million for you prompt help :)
> 
> "Joel" wrote:
> 
> > Try these changes. I added Trim() method and added a message box to indicate 
> > when the data is not numeric to help isolate the problem.
> > 
> > Private Sub cmdCalculate_Click()
> > If IsNumeric(Trim(Me.txtprice1.Value)) _
> > And TrimIsNumeric(Me.txtprice2.Value)) _
> > And TrimIsNumeric(Me.txtprice3.Value)) _
> > And Trim(IsNumeric(Me.txtprice4.Value)) _
> > And Trim(IsNumeric(Me.txtprice5.Value)) _
> > And Trim(IsNumeric(Me.txtprice6.Value)) _
> > And Trim(IsNumeric(Me.txtprice7.Value)) _
> > And Trim(IsNumeric(Me.txtprice8.Value)) Then
> > Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
> > + CDbl(Trim(Me.txtprice2.Value)) _
> > + CDbl(Trim(Me.txtprice3.Value)) _
> > + CDbl(Trim(Me.txtprice4.Value)) _
> > Original Source: The Code Cage Forums 
> > http://www.thecodecage.com/forumz/excel-vba-programming/154415-code-sum-8-textboxes.html#post559813
> > + CDbl(Trim(Me.txtprice5.Value)) _
> > + CDbl(Trim(Me.txtprice6.Value)) _
> > + CDbl(Trim(Me.txtprice6.Value)) _
> > + CDbl(Trim(Me.txtprice7.Value)) _
> > + CDbl(Trim(Me.txtprice8.Value))
> > Else
> > msgbox("Amounts are not Numbers")
> > End If
> > End Sub 
> > 
> > 
> > "Rachel" wrote:
> > 
> > > Hi there,
> > > I am trying to get a text box (txtsubtotal) to sum 8 other 'price' text 
> > > boxes (txtprice1...txtprice8) when a command button (cmdCalculate) is 
> > > clicked. Each 'price' text box is filled via a combo box (cboitem1) change 
> > > code.
> > > Here is briefly what I have:
> > > 
> > > Each combo box is coded like this:
> > > Private Sub cboItem1_change()
> > > Me.txtprice1 = WorksheetFunction.VLookup(Me.cboItem1, Worksheets 
> > > _("Pizzas").Range("A:B"), 2, 0)
> > > End Sub
> > > 
> > > Each 'price' text box is coded like this:
> > > Private Sub txtprice1_change()
> > > txtprice1.Value = Format(Me.txtprice1.Value, "$#,##0.00")
> > > End Sub
> > > 
> > > And the command button click is:
> > > Private Sub cmdCalculate_Click()
> > > If IsNumeric(Me.txtprice1.Value) _
> > >  And IsNumeric(Me.txtprice2.Value) _
> > >  And IsNumeric(Me.txtprice3.Value) _
> > >  And IsNumeric(Me.txtprice4.Value) _
> > >  And IsNumeric(Me.txtprice5.Value) _
> > >  And IsNumeric(Me.txtprice6.Value) _
> > >  And IsNumeric(Me.txtprice7.Value) _
> > >  And IsNumeric(Me.txtprice8.Value) Then
> > >    Me.txtSubTotal.Value = CDbl(Me.txtprice1.Value) _
> > >                                + CDbl(Me.txtprice2.Value) _
> > >                                + CDbl(Me.txtprice3.Value) _
> > >                                + CDbl(Me.txtprice4.Value) _
> > >                                + CDbl(Me.txtprice5.Value) _
> > >                                + CDbl(Me.txtprice6.Value) _
> > >                                + CDbl(Me.txtprice6.Value) _
> > >                                + CDbl(Me.txtprice7.Value) _
> > >                                + CDbl(Me.txtprice8.Value)
> > > End If
> > > End Sub
> > > 
> > > However it seems to work only sometimes. At the moment when I click 
> > > cmdCalculate when the form is 'live' nothing happens at all. It has worked 
> > > before though. It seems when I get a run-time error on any different 
> > > unrelated code it stuffs this one up.
> > > 
> > > What am I missing?
> > > 
> > > Thanks in advance :)
0
Utf
11/17/2009 5:25:19 AM
Reply:

Similar Artilces:

Integrate Paycodes, benefit codes and deduction codes
Has anyone used integration manager to update new pay rates, deduction amounts and benefit amounts for employees? At the beginning of each year, our company gives pay increases and we need to update the pay codes, deduction codes and benefit codes for 40 employees, which we get the information from a spreadsheet. I thought that maybe I could use integration manager to update the pay, benefit and deduction codes instead of going into each employee's card, which is time consuming. Thanks, Laura Integration Manager will allow you to do this. Use the Payroll Master Destination. one ...

zip codes don't merge #2
I am trying to mail merge w/ Word 2000 the names and addresses in my worksheet. When I get to the part to choose the format for the mailing labels, I choose F1, F2, etc. to F6 (which is the zip code column). A few do get there, but the vast majority stop at the state, leaving off the entire zip code. I have gone to menu/format and selected text in the number tab. I have gone to format/cells and chosen special/zip code in the number tab. I've read Excel for Dummies. Please help me. TIA bb ...

concatenating two vendor codes
My company recently changed the vendor codes and now I end up with two separate sets of data for each vendor. Obviously I could just leave the vendor code field out. I don't want to do that so what I need to do is concatenate the two codes. Example Vendor Code Vendor Name 123 Joe's Supplies ABC Joe's Supplies what I need is this Vendor Code Vendor Name 123/ABC Joe's Supplies any ideas? Rather than create a new record for each vendor, add another field to the table -- call it NewVendorCode -- and put th...

Can MS EXCEL remove duplicates and separate by color coded items ?
Can MS EXCEL remove duplicates and separate by color coded items ? I am NOT technical and have just started using MS EXCEL. Can anyone PLEASE HELP me: 1. How can I automatically remove duplicates using EXCEL ? ie the same info input more than once on different lines. Can EXCEL do this ? 2, I have color coded the text in the certain lines in terms of priority. can Excel rearrange the data by color ? If yes, How do I do it ? I think I have EXCEL '97 Thanks for your help in advance. Hi 1. You can extract the unique items to a new list using menu Data > Filter > Advanced fil...

16 bit code
Hello, I have a 16 bit code to maintain. (It is too complex to copile it to 32 bit) so all we are doing is support. Now they want to add a small feature, where I need to copy long file names in the project. I know we can not do long file name copies in vc++ (1.52). So I wrote a program in VC++(6.0) which does directory copy. My questions are 1. How can I call a 32 bit exe (I guess WinExec should work)? 2. How can I make the 16 bit to wait till the 32 bit code completes? 3. Is there any other better way to do this? (other than converting to 32 bit) Thanks. I actually do this in an old 16-bi...

area codes is auto filling my own 9 digit ph# vs just area code
When I enter a phone number for a contact it autofills with my personal area code and phone number instead of just the area code. How to I change this to just autofil the area code? I am using Outlook 2007 on an ACER laptop. Make sure you have your area code entered correctly in "Dialing Properties". "Computer Dummy" wrote: > When I enter a phone number for a contact it autofills with my personal area > code and phone number instead of just the area code. How to I change this to > just autofil the area code? I am using Outlook 2007 on an ACER ...

VBA Code for Pasting Sheets
I would like a spreadhseet that pastes the contents of one sheet into another sheet. I like like to do this for 7 different sheets For example: I would like paste the contents form sheet titled "sheet1" into a sheet titled "data1". Continue to process for pasting "sheet2" into "data2" and "sheet3" into "data3" all way until "sheet7" and "data7". thanks, Curt Subject: Automated Copy Paste Subject: Copy/Paste Import/Export Data VBA Code On Apr 27, 10:49=A0am, Curt <C...@discussions.mi...

MC/VISA joint code
Isn't there any way to combine the blocks (4* & 5*) for MC/VISA credit cards? It's a pain to have them separate because my bank posts them together. It is the same company afterall. It would save me a lot of time adding separate entries together to reconcile the statement! I do not know of a way to do what you are asking, but I have found that using the # symbol as follows works better than using the * symbol: 4############### 5############### If you use the * symbol it is a wild card with no determined length. The # symbol requires that the characters after the first d...

Money 2004 - Experian Offer
I just loaded Money 2004 Deluxe and converted my 2003 files with no problem. I decided to give the free year of credit monitoring from Experian a try but after filling everything out I get an error that the provided code has expired. I neither had nor provided any code for this offer, I only used the link from Money 2004. Now Experian was more than willing to set up a $79 account if I wanted to proceed. Any solution out there? I have the same problem... I am looking for a FREE way to contact Microsoft about this problem. >-----Original Message----- >I just loaded Money 2004 ...

Analytical Accounting
Hi, One of my Client's is considering to go down AA path with approx 300,000 AA dimension codes. I would like to hear whether such data set is manageable from Query wizard etc. appreciate your thoughts. Good Morning PR, I found that the issue isn't the number of AA Trx Dim Codes it is the size of the AAG30000 and AAG40000 tables the more entries the longer it takes to product the report. I had one client that started having a cached SSRS report with AA information as a management level report and a different SSRS report with a more restrictive dataset for reporting ...

Change code with code?
Hi All..... I've got 31 Excel .xlsm files to modify the "Change Event" macro in. Is it possible to open and perform this with code, or must I do each one by hand? TIA Vaya con Dios, Chuck, CABGx3 If it is the same change in each sheet, it would probably be just as easy to go into the VBE, double click on the first sheet, make the correction, then copy that correction and double click the second sheet, delete and paste. Repeat the process 30 times. Takes less time than writing the code to do it. "CLR" <CLR@discussions.microsoft.com> wr...

Access 2003
I have a form that goes to a subform for searching. It works perfectly on my computer; however, when another user opens it and attempts to perform a search, they receive the Error Code 2455 message. When I debug, it gets stuck on "Me.book_subform.Form.Filter = strWhereSearch" and says that book_subform cannot be found. It isn't a rights issue, it isn't a mapping issue. What am I missing? check your naming. This is an issue that often confused. In this syntax: Me.book_subform.Form.Filter > = strWhereSearch book_subform is the name of the subform control on the main ...

Coding Duplicate Records
How can I code that a record is to be "K" kept or "D" deleted when compared to its next row? Example: A sorted file by Address BEFORE LastName Address Sales Date Keep/Delete 1. WASSEM 0N642 TITUS PL 67,500 6/25/2001 2. HART 0N655 E WEAVER CIR 70,000 3/19/2001 3. HART 0N655 E WEAVER CIR 40,000 3/19/2001 4. HART 0N655 WEAVER CIRCLE 33,700 6/19/1998 5. POYTH 0N662 W WEAVER CIR 294,690 6/21/2000 6. BLAND 0N670 GREEN PL ...

Write a code by code
How can I write a code from procedure to some Workbook's ThisWorkbook? With procedure1 a make Workbook with a table. I need to write Auto_Close procedure to ThisWorkbook which makes some controls before I close it. Is it possible? <jenista.j@discussions.microsoft.com> wrote in message news:0be501c52fab$ba0b6830$a601280a@phx.gbl... > How can I write a code from procedure to some Workbook's > ThisWorkbook? With procedure1 a make Workbook with a table. > I need to write Auto_Close procedure to ThisWorkbook which > makes some controls before I close it. Is it possible? ...

help with/for pivottable code
Hi everyone! I have code that takes a large workbook and divides it into a number of separate new workbooks based on data that is in column A. What i need is to create code that will create a pivot table in the new workbook. here is my code: Sub Regionalize() Dim wks As Worksheet Dim wksNew As Worksheet Dim wbk As Workbook Dim rng As Range Dim cell As Range Dim lRow As Long Dim sFileName As String Dim sFolder As String Dim sRegion As String Set wks = Sheets("region") Set rng = wks.Range("regiondata") ...

Lookup and sum formula? Not sure?
I am trying to use 2 sheets. summarysheet <-------displays total cost for all rows that are part of 20 seperate job #'s datasheet <-------place to enter (in order) all bills received The colums of the datasheet are: job# Date Description Reference Gst Pst Now i want to be able to add as many rows and job numbers as possible to the datasheet, but have all entries of job 600 to sum and display on the summary sheet. There are usually 20 ongoing jobs to count and have sums for. ANy ideas how I can do this? -- r...

Rebar example code
Can anyone send me a rebar code example. There does not seem to be any examples other than Microsoft documentation. Theres nothing on CodeProject or else where. Many thanks in advance, Aaron On 8 Apr 2007 13:30:14 -0700, "AaronNGray" <aaronngray@gmail.com> wrote: >Can anyone send me a rebar code example. There does not seem to be any >examples other than Microsoft documentation. Theres nothing on >CodeProject or else where. > >Many thanks in advance, > >Aaron CodeProject has that... https://secure.codeproject.com/docking/#ReBars : http://www.codepro...

Intel I7 4 core .. why showing 8 cpus in system ?
Intel I7 4 core .. why showing 8 cpus in system ? Odd .. now using a Intel i7 quad core cpu . but the performance tab is showing 8 cpu history plots and the device manager is listing 8 cpu's ? is this anything to do with 32 / 64 bit ? G .. It's called Hyper-Threading technology. The quad core will show 8 threads available to the operating system which means better performance. -- The Real Truth http://pcbutts1-therealtruth.blogspot.com/ *WARNING* Do NOT follow any advice given by the people listed below. They do NOT have the expertise or knowled...

Replicating Code!!!
Hi there folks, I am currently creating a student achievement spreadsheet and I a using ticks in each cell to state if the student has passed the unit o not. I am using a simple VBA code to have any cell, within a specifie range, ticked upon selecting it. If the cell within the specifie range, already has a tick, the code will remove it. The trick to th code is the use of the letter "a" in a cell that has had it's fon formatted to marlett!! My code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target,...

Code to delete rows not working
Hi, I hope someone can help with this. This is probably really obvious, but I've got the following code held on Sheet 2 of a 3 sheet document. The cells concerned are filled by data from Sheet 1: =Sheet1!A6, for example. I can't see why it wont work. Basically, I want those A-column cells on Sheet 2 which don't hold a value (their corresponding sheet on Sheet 1 is empty) to hide their row. I've tried ascribing a value in the 'If cell.Value=' section. (The cells are formatted for dates. A nil return is giving me 00-Jan-00; I've tried using If cell.Value<01-Jan-0...

finance code
I am writing a installment finance program for financing home products. Does anyone know where I can get the formula or code for the "APR" (Annual Percentage Rate) that must be listed on the finance contract. I am have a lot of problem with this. Thanks -- becker Open any code window, and on the menu, chose Help, then type in "Rate". The rate function is what you are looking for. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "becker" <becker@discussions.microsoft.com> wrote in message news:80A...

Error Code 0x80092026
I keep getting this error when i try and update my XP Pro SP3 machine via windows update. I have deleted the Safer key but i still get this error when trying to update. The PC has not updated for 3 months now and i've tried all the suggestions i can find on here but to no avail. kgbrisc1 wrote: > I keep getting this error when i try and update my XP Pro SP3 > machine via windows update. > > I have deleted the Safer key but i still get this error when trying > to update. The PC has not updated for 3 months now and i've tried > all the suggestions i can...

Bar Codes
I work at a help desk in a university setting. Teachers are using Excel more and more to create grade books. SOme of them need to format parts of their data into a bar code (items like an ID number). How can I do this? Thanks in advance, Michael mjlucas@stritch.edu Download a bar code font, I always use 3 of 9 ....http://www.barcodesinc.com/free-barcode-font/ On your worksheet format the cell to this barcode font. For it to work properly you must include "*" at the start and end of your data. Start and stop data points. For example in cell A2 enter = "*" & B...

User Form Coding
Hi All Could somebody look at my coding (below) I have a user form that makes appointsments by adding data to a booking sheet. That works fine. But I have also have a command button to open another form to cancel or reshedule the appointments. In order to find a client and the appointment details I use the below code. But I can't seem to get it to work. Any help please. Appoitment worksheet A..........B...........C................D......................E..........F........G.....H custID..Surname..First Name..Contact number..Salon..Date..Time..Treatment Bookings worksheet A..........B......

error code 937001
I have Windows Vista and started getting error code 937001 when trying to install updates System Update Readiness Tool for Windows Vista (KB947821) [September 2009] Any suggestions would be appreciated. regards Niyam Right-click on My Computer & select Properties: What Windows version is displayed in the resulting General tab (e.g., Windows Vista Ultimate Service Pack 2)? What anti-virus application or security suite is installed and is your subscription current? What anti-spyware applications (other than Defender)? What third-party firewall (if any)? Were any of...