Results 1 to 2 of 2

VBA to merge cells automatically when text is typed into cell.

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2019
    Location
    Sunshine Coast
    MS-Off Ver
    2010
    Posts
    13

    VBA to merge cells automatically when text is typed into cell.

    Managed to get a solution. Solved

    I am trying to as you type into certain cells it merges with the next cell next to it.
    Therefore If E1 contains Kayaking or SUP or Canoeing or (keep going etc for a several more) it merges E1 to E2.
    These ranges would be in several rows down in several columns.
    If specific text found in a row in column E, merge with column F
    If specific text found in a row in column I, merge with column J
    If specific text found in row in column M, merge with column N etc

    I have written a macro that does this, however would like to do it when you type into a cell so it shows. I know merging cells keeps the left most information, the cell to right would be blank anyway.
    I found an old post, cannot remember where now that had a similar problem, but this merges only when you click left and not enter is pressed and I am struggling to adapt it. The code is below.
    For Each rw In Selection.Rows
    If Cells(rw.Row, 1) = 5 Then 'column A of each row
    Range(Cells(rw.Row, 3), Cells(rw.Row, 6)).Merge
    End If
    Next rw
    End Sub
    Attached Files Attached Files
    Last edited by Matthew2; 09-24-2021 at 12:18 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Automatically Merge Cells if has the same cell value
    By dedark05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-10-2020, 04:15 AM
  2. [SOLVED] Repeat text typed in one cell automatically in another cell
    By SueS in forum Excel General
    Replies: 3
    Last Post: 07-21-2014, 10:59 PM
  3. Can Macros be set to automatically run when something is pasted or typed into a cell?
    By Lylestyle89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2013, 09:06 PM
  4. Replies: 5
    Last Post: 02-23-2007, 12:11 PM
  5. Can numbers be typed to automatically be negative in cells?
    By finnplan in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-08-2005, 06:30 PM
  6. [SOLVED] Excel merged cell - can it automatically expand as text is typed?
    By Joanne (JAS) in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-07-2005, 09:06 PM
  7. Excel merged cell - can it automatically expand as text is typed?
    By Joanne (JAS) in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-07-2005, 07:06 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