+ Reply to Thread
Results 1 to 2 of 2

Formula generator, using variable as one of the numbers with VBA

  1. #1
    Registered User
    Join Date
    10-21-2020
    Location
    Liverpool, UK
    MS-Off Ver
    Office 365
    Posts
    9

    Formula generator, using variable as one of the numbers with VBA

    Hi,

    I am trying to idiot proof a new spreadsheet. In the sheet I use the following formula for time "=f10+(1/24*3) where the last number is the length of support. I want to make a formula generator to change this last digit. I tried:

    Sub CreateFormula()

    Dim x As Integer
    x = Range("bp154").Value
    Range("bq154").Formula = "=bp154+(1/24*x)"
    Range("bq154").Select

    End Sub

    And it didn't work, any advice where i went wrong?

    Thanks,

    Craig

  2. #2
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    401

    Re: Formula generator, using variable as one of the numbers with VBA

    Hi

    maybe this..
    Please Login or Register  to view this content.
    zeddy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Lottery numbers generator without history numbers
    By Wlad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2020, 08:12 AM
  2. [SOLVED] Random numbers generator
    By GPetcu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2017, 05:31 AM
  3. [VBA] Create a random unique numbers generator without functions
    By alexgoaga in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2017, 07:33 AM
  4. Randnmber Generator with no numbers repeated
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2014, 12:00 PM
  5. Defined numbers - generator.
    By LOxEN in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-02-2012, 10:16 AM
  6. Random numbers generator
    By Eric Excels in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2011, 08:49 AM
  7. Random number generator and matching all numbers
    By Zyphon in forum Excel General
    Replies: 2
    Last Post: 03-14-2008, 04:40 AM

Tags for this Thread

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