+ Reply to Thread
Results 1 to 3 of 3

Button to run typing macro

  1. #1
    Registered User
    Join Date
    01-12-2019
    Location
    egypt
    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
    XL 2010,2016
    Posts
    11,720

    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
    egypt
    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)

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