+ Reply to Thread
Results 1 to 26 of 26

Issue - CODE Tags distorting line breaks

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Issue - CODE Tags distorting line breaks

    This has been a problem since the upgrade but now its getting weirder. At first when CODE tags were used they used to remove all the empty rows between texts so that it all got smushed into a tight set of vba instructions. Now it seems that it is doing at random. Here is the code without code tags and with to show the difference:

    Without Code Tags:

    Please Login or Register  to view this content.
    Last edited by abousetta; 03-28-2012 at 07:08 AM.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    Abousetta,

    If i understand your issue correctly, do you mean to say that even if you posted code using code tags like this
    Please Login or Register  to view this content.
    It would display it like this?
    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: CODE Tags distorting line breaks

    You better use:

    Please Login or Register  to view this content.



  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Hi Arlette,

    No, the opposite. I want the line breaks to stay the same as it makes reading the code easier. For example which one of thes is easier to read:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Thanks snb. I will post your suggestion to the OP.

    FYI: Here is the thread with the new suggestion from snb. I just modified it a bit because the OP wanted to append a string, but great work snb for the suggestion.
    Last edited by abousetta; 03-28-2012 at 06:38 AM.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    Abousetta,

    I guess it all depends on how your code is in your VBE window before you copy paste it here. I have observed that if i have line breaks, they appear here, if i dont, they dont. Is that not the case with you?

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Could you go back to Post #1 and see the difference between with and without Code Tags. One has the correct line breaks and the other doesn't. They are identical codes except one is using the Code Tag feature and the other not.

    P.S. I have highlighted the differences so that they can appear better
    Last edited by abousetta; 03-28-2012 at 06:55 AM.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: CODE Tags distorting line breaks

    Option Explicit


    Please Login or Register  to view this content.
    This is copied from the first post without tags. I pasted into the VB Editor. Copied & pasted with Code tags.

    Can't see any problems
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Tried that, but still same problem. Trying to upload an image, but that doesn't seem to be working either. Maybe will try later in the day.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    What issue are you facing why uploading the image? Not trying to hijack this thread, but just asking.

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    trying to upload a png file to show what my the code looks like in my VB Editor but the upload meter just spins but no file is attached. Maybe the system doesn't support png files.

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    PNG files are supported upto a max of 100kB in size.

  13. #13
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Please Login or Register  to view this content.
    Still the same issue
    Attached Images Attached Images

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: CODE Tags distorting line breaks

    Just to be clear, I can live with this, but it's really weird why this is happening.

  15. #15
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    I am still not seeing any issue. Are you trying to explain about the indentation going bad? I am not seeing any problem with the line breaks.

  16. #16
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: CODE Tags distorting line breaks

    I can't see any difference

  17. #17
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    In Abousetta's code there is no space between the lines starting with "myFile = ...." and " ' Read the information...", as well as between the lines "NewString = OldString.." and " ' Write the information...".

    Not sure if it's a product of how it is being copied/pasted, how the code tags are added or Abousetta's PC, though. In my code snippet below, notice there is no gap between the lines "lRow = .Range...." and the ensuing comment line " ' Insert formula into...". Perhaps that is the issue - within CODE tags, if a blank line is followed by a comment line, the blank line is removed??

    Please Login or Register  to view this content.
    So you know, I write in my CODE tags. I don't use the # button. (I did try it using the # button and previewed the post, but the same spacing issue happened.)

  18. #18
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    Testing. Hmm, nope. I removed the comment from above "With .Range("K1")" and it removes the blank line too. Definitely strange, as I know I've posted code previously and it spaces properly.
    Please Login or Register  to view this content.
    Last edited by arlu1201; 03-28-2012 at 01:39 PM.

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    In my code snippet below, notice there is no gap between the lines "lRow = .Range...." and the ensuing comment line " ' Insert formula into..."
    I am seeing the gap. I will put in some text to show u the gap in your code above. Why is it you are saying "there is no gap"?

  20. #20
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    Ah, it's the browser.

    In Firefox 10.0.1, the gap appears and the code is more readable. In IE 9.0.8112.16421, the gap is missing.

  21. #21
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    Thats weird, i checked this thread in IE 7 and Chrome 17 and its showing me the gap.

  22. #22
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    IE9 is a different beast than IE7. There are quite a few things that act differently, even within my corporate environment. The tech team should probably be testing on at least IE8, if not IE9 anyway. IE7 is now over 5 years old. (Is the team able to see the browser usage statistics by version? If so, they may want to lean toward testing in the most commonly used client browsers.. who knows, that may still be IE7, heaven forbid.)

  23. #23
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    Actually, the tech team uses IETester, through which they can test using all versions of IE.

  24. #24
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    Hmm, it must not do a good job for IE9 then. There are other things - like clicking the "Go to first unread post" in IE9 doesn't work for me, it just takes me to the top of the thread. In Firefox 10 it works properly.

  25. #25
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: CODE Tags distorting line breaks

    Yeah, we had issues reported by a couple of users who use IE 6 i guess. They were not able to see the icons displayed in the quick reply box.

  26. #26
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: CODE Tags distorting line breaks

    Hopefully you suggested they upgrade their browser to something that is not a virus magnet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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