+ Reply to Thread
Results 1 to 9 of 9

Cell = Formula issue

Hybrid View

EFGMan Cell = Formula issue 01-04-2007, 08:04 PM
VBA Noob Hi, Try this code. To add... 01-04-2007, 08:36 PM
EFGMan Thank you for the reply. I... 01-05-2007, 05:47 PM
VBA Noob See attached. Change C26 ... 01-05-2007, 05:54 PM
EFGMan TY - That is exactly what I... 01-09-2007, 12:31 PM
VBA Noob Hi, It done with code. It... 01-09-2007, 01:07 PM
EFGMan :eek: UDMan. Perfect in every... 01-09-2007, 01:18 PM
  1. #1
    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

    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
    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 !!!

  2. #2
    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

  3. #3
    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

  4. #4
    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

  5. #5
    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

    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
    VBA Noob

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

  7. #7
    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

+ 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