+ Reply to Thread
Results 1 to 31 of 31

Macro to insert comment in a fixed size w/ shortcut

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Macro to insert comment in a fixed size w/ shortcut

    Hi

    I'd like a macro to insert a comment in a fixed size ( x 2.5 ) but do not want to use the Properties - Appearance - Advanced - Item - Tooltip route.

    Ideally with a shortcut, e.g. Shift+F2


    I've seen this on Debra Dalgleish's site -

    Please Login or Register  to view this content.
    But this doesnt seem to set the size of the comment box.

    Any help is much appreciated !

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    Is 2.5 the width or the height?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, both width and height should be 2.5

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    Please Login or Register  to view this content.
    Untested

  5. #5
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    content deleted by poster
    Last edited by elgato74; 01-24-2014 at 09:32 AM.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    I would look at how the information gets to comment. I would probably be easier to manipulate the data as the comments are being created. Or possibly even before that. After the information is placed in a comment its going to be more difficult to create custom formatting like you have above.

  7. #7
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    yeah, i was thinking that too. the addresses are simply copied/pasted from Amazon/eBay into the Comment box. Altering each comment would just take so much time...

  8. #8
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    Perhaps they could be copied and pasted into cells in a column. Then you could have a macro that reorganizes the information and creates comments at the same time?

  9. #9
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    yes, that would be wonderful. but how to ?

  10. #10
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    Can you provide a sample workbook showing the following:

    1. What addresses copied from amazon and pasted into a cell looks like
    2. What column the addresses will be
    3. Where you want the comments input
    4. An example of how each same address should be modified

  11. #11
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    something like this:

  12. #12
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Column A is the original address copied/pasted from Amazon
    Column B is what the adress should be modified to
    Column C has the comment with the modified address, ready to be extracted by another macro to a csv file

  13. #13
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to insert comment in a fixed size w/ shortcut

    When the address are pasted from amazon they are pasted into different cells?

  14. #14
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    yes thats right

  15. #15
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, elgato,

    what about some more samples to determine if the length of each set of data is identical - and a very good reason for using DE instead of D, BRD, GER. How many countries will you cover, and do you have more abbreviations like DE, SWZ or IT? Up to now Split could be used to obtain the results but thatīs depending on the number of cells filled or empty cells. And I guess the second Berlin stands for Bundesland?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  16. #16
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hello Holger, Guten Tag !

    I filled the sample book with some more addresses, which all should be formatted in the same way

    1. Name
    2. Street Name
    3. House Number
    4. ZIP
    5. City Name
    6. Country ( Iso Code DE, FR, UK, IT... )
    7. Phone Number

    Any yes, the second Berlin stood for Bundesland.

    The reason I need this is to fill out a csv-file for the import to DHL

  17. #17
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Here is the "csv-maker" file to give you an idea of the overall task:

  18. #18
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, elagto74,

    there is no consistency that I can make up for any code to work. FOr the german as well as the fernch address the street name and house number are in the second row. For german housen number is at the end, for french at the beginning. ZIP is behind the twon name for Italy and GB.

    So this would lead me to state to scan through the area, get the country name and have functions for each individual country in order to deliver the correct correlation between what has been delieverd from the system and what you want from it for the other software needed.

    A sample to determine what Function/Sub to call may look like
    Please Login or Register  to view this content.
    Youīll find the information in the Immediate Window / Direktfenster stating start line for a range, the Function/Sub to call and the number of cells the address covers. Please mind that the blank in between the words is either Chr(32) or CHR(160):
    Please Login or Register  to view this content.
    Ciao,
    Holger

  19. #19
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hello Holger,

    wow, thats quite some code

    Here is an updated version of my "CSV-maker" with more data for you to play around with it. It works fine. However, I had to manually change all comments so they are formatted correctly for the csv file.

    How could I implement your code now, so that the comments are automatically formated ?

  20. #20
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    if this can be done at all. I guess I will have to manually change the comments

  21. #21
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, elgato74,

    it will take some time for me to check and maybe adapt the codes and calling them from the draft I have in mind, it might even take time until tomorrow morning. Iīll keep you informed about what I have come up with.

    Ciao,
    Holger

  22. #22
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    thanks so much Holger, much appreciated. the dilemma is that i receive the addresses from Amazon and Ebay in these mixed formats, and the csv file for DHL has precise fields that want to be filled in correctly

  23. #23
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, elgato74,

    it would be easier to start on working on the data thatīs inserted to transform that into a common format in order to just have one routine but the import you have right now s.... - you should get somebody to get that straight in order to avoid to have to write a routine for each and every country later on.

    All the code goes into one module as the variables only have a scope for the module they are dimmed in, due to the individual codes for the countires the code is quite a bit longer as I owuld expect it to be:
    Please Login or Register  to view this content.
    Code should do fine with the samples delievered but Iīm afraid no program will be able to detect if the First Name is listed before or after the Surname without a huge list to compare to and decide from there if the lower or upper bound of the array should be taken for the First Name. Code for GB needs to be adjusted as I took Brynna to be the town name. But I think you should get an idea on how to work with this. Again: Iīd recommend to sort of streamline the data import and just have one macro to do the work.

    Concerning transfering this information into a table: to me youīre overcomplicating this part as the data could be written into the table directly from the import without transferring it into a comment and reading out that comment. Maybe I donīt understand the need for this extra step as I canīt figure out any reason for it without knowing why this step might be necessary.

    Ciao,
    Holger

  24. #24
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi Holger,

    not quite sure what to do with this code now. I added the macro to my sample book Book1-2.xls‎ but it gives me a runtime error 1004 when running it.

    Best, Felix

  25. #25
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    ... and to answer your question. The comments contain all addresses from my customers and are part of my masterlist that has all infos regarding my orders. I do not use tools like Afterbuy or Auctionstudio where Amazon / Ebay Sales are handled. The addresses are copied/pasted directly into a comment ( so i save alot of space in my master list - see screenshot attached.)

    Attachment 290989

  26. #26
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    and from my masterlist i want to generate directly my csv-file for DHL

  27. #27
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, Felix,

    I had the workbook as a sample and I canīt get any run time error to appear (especially not a 1004).

    I changed the main code a bit:
    Please Login or Register  to view this content.
    Code should get started on Sheets("Muster") by pressing the button.

    Ciao,
    Holger
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi Holger,


    thank you so much for all that code. Still testing it. But you are right, no program will be able to detect if for example the First Name is listed before or after the Surname. I really think i need to manually format the addresses as described above:

    1. Name
    2. Street Name
    3. House Number
    4. ZIP
    5. City Name
    6. Country ( Iso Code DE, FR, UK, IT... )
    7. Phone Number

    It is a bit of a pain in the *** because I have about 1500 addresses each month

  29. #29
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    sorry double post

  30. #30
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to insert comment in a fixed size w/ shortcut

    sorry double post

  31. #31
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to insert comment in a fixed size w/ shortcut

    Hi, Felix,

    depending on the number of different settings you could create variations of the individual/local macros created and call them on a one to one base - these would need to be slightly adjusted but the basic way to handle them is laid down in the samples.

    Another idea might be to create a UserForm which may show the data split up and allow you to put them in the sequence you want. Still there would be problems regarding multiple entries which need to be put together, and Iīm not so sure that it really might be a good idea - you could use ComboBoxes for the ordernumber and List- or ComboBoxes for the entries. I donīt know how good your VBA skills are but instead of doing it all manually and each month I would at least go the first way and have a growing number of macros for the indivual countries. And I would comment the codes in order to make it easier to understand which ideas made me take that particula route to coding and for which fields in which order the code was planned.

    Ciao,
    Holger

+ 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. Macro with Vlookup but checking ranges of no fixed size
    By bernborough in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2010, 10:38 AM
  2. Modify default size of insert comment
    By Esgrimidor in forum Excel General
    Replies: 2
    Last Post: 07-18-2009, 06:26 PM
  3. Setting size of comment under macro control?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2005, 11:55 PM
  4. Need macro to insert chart w/ FIXED size & location
    By Matt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2005, 06:05 PM
  5. Insert comment behaviour on custom shortcut different
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2005, 09: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