Hi, this related to execl cells

Author Message
srinu_001241

  • Total Posts : 16
  • Scores: 0
  • Reward points : 0
  • Joined: 11/14/2011
  • Status: offline
Hi, this related to execl cells Tuesday, November 15, 2011 7:58 PM (permalink)
0
I have some information like "My name is srinu" in a cell(1,1). Just I want to convert only the colour of "srinu" in the cell to red. how can I do that by using vbscript.
Thanks in advance
 
#1
    59cobalt

    • Total Posts : 972
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: online
    Re:Hi, this related to execl cells Wednesday, November 16, 2011 9:16 AM (permalink)
    0
    Set xl = GetObject(, "Excel.Application")
    start  = 12
    length = 5
    xl.ActiveSheet.Cells(1, 1).Characters(start, length).Font.ColorIndex = 3

     
    #2
      srinu_001241

      • Total Posts : 16
      • Scores: 0
      • Reward points : 0
      • Joined: 11/14/2011
      • Status: offline
      Re:Hi, this related to execl cells Wednesday, November 16, 2011 11:50 PM (permalink)
      0
      This is working. Thanks a lot Cobalt.
       
      #3
        59cobalt

        • Total Posts : 972
        • Scores: 91
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: online
        Re:Hi, this related to execl cells Thursday, November 17, 2011 8:35 AM (permalink)
        0
        I'll relate your thanks to Excel's macro recorder.
         
        #4
          srinu_001241

          • Total Posts : 16
          • Scores: 0
          • Reward points : 0
          • Joined: 11/14/2011
          • Status: offline
          Re:Hi, this related to execl cells Thursday, December 22, 2011 4:46 AM (permalink)
          0
           
          Set xl = GetObject(, "Excel.Application") 
          start  = 12 
          length = 5 
          xl.ActiveSheet.Cells(1, 1).Characters(start, length).Font.ColorIndex = 3
           
          Hi Cobalt,
           
          I am facing problems, if the cell data contails only numeric values.
          Above statement is working fine if the cell data contains strings/alfa numerics.
          I tried in converting the cell data to string by using cstr but it didn't work.
          Could you please help me?
           
          Thanks
          <message edited by srinu_001241 on Thursday, December 22, 2011 4:48 AM>
           
          #5
            ebgreen

            • Total Posts : 8227
            • Scores: 98
            • Reward points : 0
            • Joined: 7/12/2005
            • Status: offline
            Re:Hi, this related to execl cells Thursday, December 22, 2011 4:54 AM (permalink)
            0
            Use the macro recorder in excel.
            "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
            Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
            http://www.visualbasicscript.com/m_47117/tm.htm
             
            #6
              srinu_001241

              • Total Posts : 16
              • Scores: 0
              • Reward points : 0
              • Joined: 11/14/2011
              • Status: offline
              Re:Hi, this related to execl cells Thursday, December 22, 2011 5:29 PM (permalink)
              0
              Thanks......
               
              #7

                Online Bookmarks Sharing: Share/Bookmark

                Jump to:

                Current active users

                There are 0 members and 2 guests.

                Icon Legend and Permission

                • New Messages
                • No New Messages
                • Hot Topic w/ New Messages
                • Hot Topic w/o New Messages
                • Locked w/ New Messages
                • Locked w/o New Messages
                • Read Message
                • Post New Thread
                • Reply to message
                • Post New Poll
                • Submit Vote
                • Post reward post
                • Delete my own posts
                • Delete my own threads
                • Rate post

                2000-2012 ASPPlayground.NET Forum Version 3.9