+ Reply to Thread
Results 1 to 9 of 9

Error in ColumnWidth Code

  1. #1
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Error in ColumnWidth Code

    Hi Guys,

    Any chance there is someone that can help me get this right?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Error in ColumnWidth Code

    Where is ColumnsWidth supposed to get its value? Is it even necessary, given that you aren't using it in the code? (it's not clear if you meant to, or if you just want the current width increased by 5)
    Rory

  3. #3
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Error in ColumnWidth Code

    Here you go, spell mistake in declared variant.
    use Option Explicit at begining of the module, to prevent these errors.

    Please Login or Register  to view this content.
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  4. #4
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Error in ColumnWidth Code

    I just want the current width increased by 5

  5. #5
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Error in ColumnWidth Code

    I have "Option Explicit " at the top of the Module, and I get no Errors when debugging?
    I corrected the spelling mistake.
    Udklip.JPG

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Error in ColumnWidth Code

    Then all you need is this:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Error in ColumnWidth Code

    Thanks rorya

    It still gives me an Error!
    I have attached the workbook and a picture, maybe I am missing something.
    I the odd thing is, it works if I run any other macro first?? Udklip.JPG
    Attached Files Attached Files

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Error in ColumnWidth Code

    It looks like your worksheet is protected, so you'll need to unprotect it first.

  9. #9
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Error in ColumnWidth Code

    Thanks rorya

    Yes, that was the problem, and it is sortet out now.

    Thankyou for your help.

+ 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. [SOLVED] How do i swear columnwidth listbox
    By mido21 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2017, 01:52 AM
  2. ColumnWidth Problem
    By Jarod9856 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2015, 01:53 PM
  3. ColumnWidth vs Column.Width
    By danex in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2013, 10:21 AM
  4. Capture Activecell's ColumnWidth
    By srinivas1104 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2011, 01:33 PM
  5. Cannot set ColumnWidth past column 148
    By MNTye in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2006, 08:50 AM
  6. Replies: 2
    Last Post: 03-28-2005, 11:06 AM

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