+ Reply to Thread
Results 1 to 12 of 12

How to retain superscript format?

  1. #1
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    How to retain superscript format?

    Hello dear ExcelForum!

    I have this part of code to paste columns rows Formulas and cell formating:
    Please Login or Register  to view this content.
    But i can't get it to work. It's always shows cells without superscript format. Acctually, i have 2 cells with superscript.

    Previously, when i was using the old code: >example of another code<

    Please Login or Register  to view this content.
    Then code runned smoothly, showing correctly all cells.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    Try this method

    Before PasteSpecial.jpg

    .

    After Paste Special.jpg

    .

    Working example in attached workbook
    - run with {CTRL} k

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 03-19-2018 at 06:55 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    what is this in your code? does it work?
    Please Login or Register  to view this content.
    Last edited by kev_; 03-19-2018 at 07:06 AM.

  4. #4
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: How to retain superscript format?

    "There's already data here. Do you want to replace it?"


    NOT WORKING!

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: How to retain superscript format?

    Quote Originally Posted by kev_ View Post
    what is this in your code? does it work?
    Please Login or Register  to view this content.
    It's working. Except superscript

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    NOT WORKING!
    Really!
    It works in the example file - I tested it

    .

    "There's already data here. Do you want to replace it?"
    Use this to avoid that message warning the user:
    Please Login or Register  to view this content.
    Last edited by kev_; 03-19-2018 at 06:25 PM.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    what is this in your code? does it work?
    .PasteSpecial xlPasteRowHeights

    It's working. Except superscript
    really?

    These are the valid options according to Microsoft:
    xlPasteAll
    xlPasteAllExceptBorders
    xlPasteAllMergingConditionalFormats
    xlPasteAllUsingSourceTheme
    xlPasteColumnWidths
    xlPasteComments
    xlPasteFormats
    xlPasteFormulas
    xlPasteFormulasAndNumberFormats
    xlPasteValidation
    xlPasteValues
    xlPasteValuesAndNumberFormats

    and Excel itself does not contain it either ...

    Row heights.jpg

    .

    I am very interested - I do not know about this option - I cannot get your code to work
    - please attach a file with working code that copies row height from A1 to A2 using PasteSpecial
    thank you
    Last edited by kev_; 03-19-2018 at 06:59 PM.

  8. #8
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: How to retain superscript format?

    Please Login or Register  to view this content.
    The code even won't to paste cell borders



    Please Login or Register  to view this content.
    Maybe, kev_'s code must be outside IF statement?
    Last edited by B.W.B.; 03-19-2018 at 11:13 AM.

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    The code even won't to paste cell borders
    - used correctly borders are pasted with PasteSpecial (xlPasteFormats)

    .

    Maybe, kev_'s code must be outside IF statement?
    NO! - the reason it is not working is because you have not used EXACTLY the same method. Excel is fussy here

    My code (post#2) :
    Set Rng = Sheets("CopyFrom").Range("A2:C2")
    Set rng2 = Sheets("CopyTo").Range("A1:C11") - here I used all columns and rows

    Your code (post#8) :
    Set IZV = Sheets(".....IZVJEŠTAJ").Range("B2:k67")
    Set BCK = Sheets("Izvještaj_BACKUP").Range("B2") - here you only used the first cell

    Try this (use the full range):
    Please Login or Register  to view this content.
    Code below is the same as above but may be more useful method if not pasting to exactly the same range in a different sheet
    - it ensures that both ranges are the same size
    Please Login or Register  to view this content.
    Last edited by kev_; 03-19-2018 at 06:54 PM.

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    1. I have been thinking about (line in your code in post#1)
    Please Login or Register  to view this content.
    2. When I asked you about it, your reply was - "It's working. Except superscript"

    3. Your reply is not correct - VBA throws an error with .PasteSpecial xlPasteRowHeights....

    PasteSpecialRowHeights.jpg

    4. Unless your original code contains this line....
    Please Login or Register  to view this content.
    5. The pasted row heights were correct for a different reason
    Last edited by kev_; 03-20-2018 at 04:13 AM.

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to retain superscript format?

    Did post#9 resolve your problem?

  12. #12
    Forum Contributor
    Join Date
    11-26-2014
    Location
    Bosnia&Herzegovina
    MS-Off Ver
    Office2013
    Posts
    281

    Re: How to retain superscript format?

    Quote Originally Posted by kev_ View Post
    Did post#9 resolve your problem?
    Thank YOU kev_ for your intereset,........not working
    CaptureA.JPG

    Please Login or Register  to view this content.

+ 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. Need a VB Script to concatenate and retain superscript
    By bltzkri3g in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2015, 01:49 AM
  2. Referencing a cell with superscript format maintained
    By alex.harrison in forum Excel General
    Replies: 3
    Last Post: 03-30-2015, 10:54 AM
  3. Custom Format Superscript
    By matteobsuetti in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-19-2015, 01:40 PM
  4. [SOLVED] Format digit to superscript if ...
    By JPGraphX in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-05-2014, 03:39 PM
  5. Replies: 1
    Last Post: 11-08-2005, 05:50 PM
  6. [SOLVED] Superscript in a Custom Format
    By Sloth in forum Excel General
    Replies: 1
    Last Post: 09-15-2005, 05:05 PM
  7. Superscript in custom format
    By Sloth in forum Excel General
    Replies: 2
    Last Post: 09-15-2005, 11:05 AM

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