+ Reply to Thread
Results 1 to 4 of 4

Record Changing Value in a Cell with VBA

  1. #1
    Registered User
    Join Date
    03-13-2020
    Location
    usa
    MS-Off Ver
    win7
    Posts
    13

    Record Changing Value in a Cell with VBA

    Hello,

    Does anyone know how to get the results/records in Horizontal (row) instead of Vertical?

    Thanks in advance...

    [Dim xVal As String
    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 + 1
    Else
    If xVal <> Range("C2").Value Then
    Range("D2").Offset(xCount, 0).Value = xVal
    xCount = xCount + 1
    End If
    End If
    Application.EnableEvents = True
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    xVal = Range("C2").Value
    End Sub]
    Last edited by asac; 12-11-2020 at 05:55 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Record Changing Value in a Cell with VBA

    Try changing these entries:
    Please Login or Register  to view this content.
    to this:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: Record Changing Value in a Cell with VBA

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)

  4. #4
    Registered User
    Join Date
    03-13-2020
    Location
    usa
    MS-Off Ver
    win7
    Posts
    13

    Re: Record Changing Value in a Cell with VBA

    I will do that, and thank you for the response.

+ 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. How To Record Changing Values In A Cell In Excel
    By ivans26 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 05-20-2020, 04:45 PM
  2. Record Changing cell value in excel .
    By debonilsaha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2019, 04:19 AM
  3. Record Changing Values In A Cell
    By watermasa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2019, 07:32 AM
  4. Record a changing cell value at the end of each month
    By Samboco in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2019, 07:04 AM
  5. Automatically Record Changing Cell Value ion Separate Sheet
    By Itsfurreal in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 08-06-2017, 02:37 PM
  6. [SOLVED] automatically record data from a changing cell
    By rhaxx in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-10-2015, 08:40 AM
  7. How to record a changing cell
    By simmo86 in forum Excel General
    Replies: 2
    Last Post: 02-29-2012, 05:22 PM

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