+ Reply to Thread
Results 1 to 9 of 9

Cell = Formula issue

  1. #1
    Registered User
    Join Date
    01-04-2007
    Posts
    10

    Question Cell = Formula issue

    I'm am working on an Excell based quote sheet and have run into an issue that I'm not sure how to handle.
    I want a cell to equal it'self * a number.

    Example: I want a number to be typed into a cell, lets say 3.
    Once that cell is exited I want it to change to the equivilant of 3 * 15.
    So instead of the outcome being 3 it is now 45.
    That way I am not using multiple collums or rows for a single equation.

    I tried the formula within cell c26 as followes:
    c26*15, but Excell doesn't like that at all and I get a blue dot saying "unprotected formula".

    An ideal result is similar to when you specify a change of decimal place.
    It automaticly changes from the number you entered into that number devided or multiplied by 10, 100, etc...
    If I can control that kind of functionality that would be awsome.

    Please advise if something like this is even possible.
    Any help would be greatly appreciated.
    Thanks in advance.
    EFGMan

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this code. To add the code right click on the sheet name and select view code. Paste the code in and then close VB

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-04-2007
    Posts
    10
    Thank you for the reply. I did what you sudjested, but nothing seams to be happening. I type 3 and $3.00 is substituted, same as before. I'll go ahead and paste the current code below.

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Not Intersect(Target(1), Range("C26")) Is Nothing Then
    Application.EnableEvents = False
    With Target(1)
    'Assuming your Constant/Multiplier is 15:
    .Value = .Value * 15
    End With
    Application.EnableEvents = True
    End If
    End Sub

    Private Sub Workbook_Open()

    End Sub

    Tx EFGMan

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See attached. Change C26

    VBA Noob
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-04-2007
    Posts
    10
    TY - That is exactly what I want to happen, but I am a true nub at this.

    I don't even know what to look for to to see how you did it.

    I viewed the code and nothing was there.

    Doesn't look like there is any formatting or conditions.

    What am I missing?

    EFGMan

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    It done with code. It is called by a Change Event and the code is on the actual sheet.

    Right click the sheet tab and select view code.

    When the target is cell C26 and you add a figure it multiplies by 15

    These link might help with change events and adding the code

    http://www.cpearson.com/excel/events.htm

    http://www.contextures.com/xlvba01.html#Worksheet

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Registered User
    Join Date
    01-04-2007
    Posts
    10
    UDMan. Perfect in every way. Thank you so much.
    Happy EFGMan

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad I could help

    Thanks for the feedback

    VBA Noob

  9. #9
    Registered User
    Join Date
    01-04-2007
    Posts
    10
    blablablab
    Attached Images Attached Images
    Last edited by EFGMan; 01-12-2007 at 01:00 PM.

+ 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