+ Reply to Thread
Results 1 to 3 of 3

Beginner needs HELP with .Text

  1. #1
    Registered User
    Join Date
    10-23-2006
    Posts
    84

    Beginner needs HELP with .Text

    I have a input from a textbox called txtInCost. This is loaded to the spreadsheet with
    txtInvCost.Text = Cells(lCurrentRow, 4).Value
    and read into the code with
    Cells(lCurrentRow, 4).Value = txtInvcost.Text

    I want to take the value of txtInvcost, multiply it by 0.18 and output to the sheet with
    ?????(lCurrentRow, 5)??????

    I know I can just use =D3*0.18 on the sheet itself but that won't help me to find out how to code

    Can anyone help Please

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by GogsJames
    I have a input from a textbox called txtInCost. This is loaded to the spreadsheet with
    txtInvCost.Text = Cells(lCurrentRow, 4).Value
    and read into the code with
    Cells(lCurrentRow, 4).Value = txtInvcost.Text

    I want to take the value of txtInvcost, multiply it by 0.18 and output to the sheet with
    ?????(lCurrentRow, 5)??????

    I know I can just use =D3*0.18 on the sheet itself but that won't help me to find out how to code

    Can anyone help Please
    It would seem reasonable that

    Cells(lCurrentRow, 5).Value = Cells(lCurrentRow, 4).Value *0.18

    or that

    Cells(lCurrentRow, 5).Formula = "=D" & lCurrentRow & "*0.18"

    would work.
    (both untested)

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Bryan Hessey
    It would seem reasonable that

    Cells(lCurrentRow, 5).Value = Cells(lCurrentRow, 4).Value *0.18

    or that

    Cells(lCurrentRow, 5).Formula = "=D" & lCurrentRow & "*0.18"

    would work.
    (both untested)

    hth
    ---
    Having re-read this in conjunction with your other posts, I take it that the 0.18 is the VAT, in which case I would reccommend using the formula version rather than the calculated figure.
    Whilst you can instruct staff & helpers etc to enter data only on the userform, it is still possible to access column D and amend a figure, this would leave you with an incorrect calculation, not a desired situation where tax is involved.

    Cells(lCurrentRow, 5).Formula = "=D" & lCurrentRow & "*0.18"

    would seem the safer option.

    ---

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1