+ Reply to Thread
Results 1 to 3 of 3

Button to run typing macro

  1. #1
    Registered User
    Join Date
    01-12-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    2

    Exclamation Button to run typing macro

    Hello,

    Hope you are having good-day

    I have a complicated question

    I have a multiple changing values in multiple sheets what I want is to make a button that type all numbers that are connected to foumula to non formula cells for example:
    excel.jpg

    I want a button that when pressed all values that resulted from formula in cells (C33:K33) to be typed to (C2:K2) with no formula and can be removed when needed also I want it to
    affect a number of 6 similiar sheets contain the same table simulatanuosly

    I searched the web and had this code :

    im xVal As String
    'Update by Extendoffice 2018/8/22
    Private Sub Worksheet_Change(ByVal Target As Range)
    Static xCount As Integer
    Application.EnableEvents = False
    If Target.Address = Range("C2").Address Then
    Range("D2").Offset(xCount, 0).Value = xVal
    xCount = xCount
    Else
    If xVal <> Range("C2").Value Then
    Range("D2").Offset(xCount, 0).Value = xVal
    xCount = xCount
    End If
    End If
    Application.EnableEvents = True
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    xVal = Range("C2").Value
    End Sub


    But the problems of this code is :

    1- It only affect one cell and I want it to affect a range of cells
    2- It changes (D2) whenever c2 changes not when i want it to type the number (press the button)
    3- it affect only one sheet and I want it to affect 8 sheets

    Thanks
    M.Nasr
    Last edited by deadeye1989; 01-12-2019 at 11:32 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Button to run typing macro

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  3. #3
    Registered User
    Join Date
    01-12-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    2

    Re: Button to run typing macro

    Please find attached (password mnsh89)
    Attached Files Attached Files
    Last edited by deadeye1989; 01-12-2019 at 11:33 AM.

+ 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. Is it possible to run a macro while I am typing in a cell
    By allsourav in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-20-2016, 12:01 AM
  2. [SOLVED] VBA: How to make macro for typing specific (long) formula in cell ?
    By ChristopherH in forum Excel General
    Replies: 4
    Last Post: 03-24-2014, 12:59 PM
  3. Replies: 4
    Last Post: 03-10-2014, 04:02 PM
  4. Replies: 7
    Last Post: 09-20-2011, 01:50 PM
  5. A macro to create a form button, assign a macro and name the button
    By cl361 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2008, 01:07 AM
  6. Allowing macro to run while typing words into cells
    By Cellar Webs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2007, 02:20 PM
  7. [SOLVED] I need help writing a macro that will correct typing errors?
    By notthemacroman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2006, 08:46 PM

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