Results 1 to 8 of 8

Thread: problem in formatting comment

  1. #1

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    problem in formatting comment

    dear friend,

    i am adding comment in my "G4" row using VBA code.becos i am reading from xml.so this is dynamic population.my comment should be like this:

    i have 1000 datas. so

    karhtik mano padhu mini
    mani bani sara msla
    daya dei gen millu


    like this i need to show in comment.so please how to d olike this please show some sample code for this
    Loving dotnet

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: problem in formatting comment

    Quote Originally Posted by karthikeyan
    dear friend,

    i am adding comment in my "G4" row using VBA code.becos i am reading from xml.so this is dynamic population.my comment should be like this:

    i have 1000 datas. so

    karhtik mano padhu mini
    mani bani sara msla
    daya dei gen millu


    like this i need to show in comment.so please how to d olike this please show some sample code for this
    I am sorry, I didn't understand. Two questions...

    1) How do you decide what goes in the comment for the 1000 piece of data? or
    2) Do want the above text to go as comment in all that 1000 piece of data?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: problem in formatting comment

    please do any one reply me please
    Loving dotnet

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: problem in formatting comment

    Quote Originally Posted by karthikeyan
    please do any one reply me please

    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: problem in formatting comment

    Quote Originally Posted by karthikeyan
    please do any one reply me please
    koolsid did reply, and asked two questions.

    What are the answers to those questions?

  6. #6

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: problem in formatting comment

    dear friends,

    i am reading those 1000 values from xml and i have to addcomment in "G4" range and i have to populate those 1000 value in comment as like follows
    ex:

    karhtik mano padhu mini
    mani bani sara msla
    daya dei gen millu


    there every names are in my xml. i can able to loop through my xml values. but i would like to add comment and pass the reading values in comment like the above example.i think now it is clear.please help me to solve this pl.......
    Loving dotnet

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: problem in formatting comment

    vb Code:
    1. range("g4").AddComment "this is" & vbnewline & "a test" & vbnewline & "to see" & vbnewline & "if it works?"
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: problem in formatting comment

    hi, iam looping through the xml to add comment text as follows:

    Code:
    Dim articleDoc As New DOMDocument
      Dim NodeList As IXMLDOMNodeList
      Dim sectionNode As IXMLDOMNode
      Dim rng As String
      Dim index As Integer
      Dim comment As comment
      Dim strcomment As String
      
       
        Dim lngIndex As Long
         Dim lngChild As Long
        articleDoc.async = False
        articleDoc.validateOnParse = False
        articleDoc.preserveWhiteSpace = False
        articleDoc.Load strFileName
           Set OrgComment = Range("G4").Addcomment("Names")  
              
        Set NodeList = articleDoc.selectNodes("//Name")
        
        For Each sectionNode In NodeList
         
         'add  values in comment
        Next
    so i have to add reading values from xml in comment inside the loop. i do have 1000 names in my xml.so in comment 4 names per line with some space.so show me some sample code how to do this please help me to write code inside the loop
    Loving dotnet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width