Results 1 to 6 of 6

Merged cells lock after resizing

Threaded View

  1. #1
    Registered User
    Join Date
    05-17-2014
    MS-Off Ver
    Excel 2003
    Posts
    5

    Merged cells lock after resizing

    I really hope someone can help me with the following issue.
    I finally have the merged cells resizing the way I need, however it seems to lock the cell after the process not allowing it to be edited again until I unlock the sheet. below is the current code I am using
    Private Sub Worksheet_Change(ByVal Target As Range)
     Dim NewRwHt As Single
     Dim cWdth As Single, MrgeWdth As Single
     Dim c As Range, cc As Range
     Dim ma As Range
    
     With Target
     If .MergeCells And .WrapText Then
     Set c = Target.Cells(1, 1)
     cWdth = c.ColumnWidth
     Set ma = c.MergeArea
     For Each cc In ma.Cells
     MrgeWdth = MrgeWdth + cc.ColumnWidth
     Next
     Application.ScreenUpdating = False
     ma.MergeCells = False
     c.ColumnWidth = MrgeWdth
     c.EntireRow.AutoFit
     NewRwHt = c.RowHeight
     c.ColumnWidth = cWdth
     ma.MergeCells = True
     ma.RowHeight = NewRwHt
     cWdth = 0: MrgeWdth = 0
     Application.ScreenUpdating = True
     End If
     End With
     
     End Sub
    If anyone has ideas of what I am missing I would greatly appreciate the help.
    Last edited by Leith Ross; 05-17-2014 at 09:42 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Auto resizing inserted pictures to fit merged cells
    By crispybadger in forum Excel General
    Replies: 4
    Last Post: 02-06-2013, 05:43 PM
  2. Replies: 3
    Last Post: 01-25-2011, 09:31 PM
  3. Error: Cannot change the part of merged cell - When trying to lock cells in range
    By Ranjani in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-09-2009, 12:03 PM
  4. [SOLVED] Resizing cells in a selection without resizing entire sheet
    By Danielle via OfficeKB.com in forum Excel General
    Replies: 4
    Last Post: 08-11-2006, 05:10 PM
  5. [SOLVED] How do i insert a picture in merged cels, with autom. resizing ?
    By Sven Ghyselinck in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-27-2006, 04:30 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