+ Reply to Thread
Results 1 to 2 of 2

VBA Code skipping columns while formtting sheets.

  1. #1
    Forum Contributor
    Join Date
    01-06-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    118

    VBA Code skipping columns while formtting sheets.

    Hi

    i wrote a code to format columns based on criteria

    1) if cell value is integer (as per cell view) then cell value should remain integer
    2) if cell value is decimal with n decimals then cell value should convert to 2 decimal number
    3) if cell value is percentage then it should convert into 2 decimal value

    my code is perfectly working when i run by using F8. But when i run the code by using F5, then code skipping 1 or 2 columns (which contains %) from each sheet. in the 1st attachment contains the data before run the code. in the 2nd attachment is after running the code. yellow coloured columns not converted to 2 decimal numbers. Please help me. code should convert all percentage columns to decimal numbers in all sheets.

    thank you in advance.


    regards
    shiva
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA Code skipping columns while formtting sheets.

    You need to set lt to zero or it will keep the same value from the previous sheet.
    -
    itPic.jpg

+ 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. VBA code, combined sheets with other columns
    By trihay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2018, 12:32 PM
  2. Hide Rows in most sheets skipping hidden sheets
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-11-2016, 04:53 PM
  3. copy values from columns to rows while skipping empty columns...
    By EricCy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-10-2016, 06:20 AM
  4. Conditional formtting, excel "not responsing"/freezing
    By emque in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2014, 02:52 PM
  5. [SOLVED] Skipping over certain sheets in a For Each loop
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2013, 03:15 PM
  6. [SOLVED] loop action through all sheets in workbook skipping certain sheets
    By sawa85sa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2013, 06:40 PM
  7. IF(MOD) for skipping columns
    By rhudgins in forum Excel General
    Replies: 5
    Last Post: 07-31-2010, 02:16 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