+ Reply to Thread
Results 1 to 8 of 8

Macro to add text box based on cell property

  1. #1
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Macro to add text box based on cell property

    Hi All,

    If any cell in my active workbook has formula, then a textbox should come next to it with letter "A" in color red and in bold.

    Can anyone make this possible?

    Thanks!
    Last edited by VBA Noob; 05-02-2009 at 08:34 AM.

  2. #2
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Exclamation Re: Macro to add text box based on cell property

    Can anybody on this forum has enough knowledge to make it possible?
    Please help. Thanks!

  3. #3
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Angry Re: Macro to add text box based on cell property

    Can anybody please help me in this?

  4. #4
    Registered User
    Join Date
    04-24-2009
    Location
    Strathmiglo, Scotland
    MS-Off Ver
    Excel 2000
    Posts
    10

    Re: Macro to add text box based on cell property

    Hi

    Does it have to have a text box next to the cell? If not why dont you just highlight all the cells that have a formula and highlight red.

    Start your Macro Edit/Go to /Special / Formulas OK, Highlight Bold then Red. then stop macro.

    Whooup

  5. #5
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Macro to add text box based on cell property

    Hi,

    Thanks for your reply!

    But it have to have a text box next to the cell.

    Can anybody help please?

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro to add text box based on cell property

    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  7. #7
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Macro to add text box based on cell property

    Dear VBANoob,

    Its working like a magic. I had started to think that it is impossible to write a code for this. Many thanks!

    The only problem I face is that if there is any worksheet in the active workbook, which has no formula containing cell then the macro displays an error. I believe you can fix that.

    Here is the code -

    Sub AddTextBox()

    Dim Worksheet As Worksheet
    Dim TextBox As Shape
    Dim Range As Range
    Dim Cell As Range

    For Each Worksheet In Worksheets
    Set Range = Worksheet.UsedRange.SpecialCells(xlCellTypeFormulas, 23)
    For Each Cell In Range
    Set TextBox = Worksheet.Shapes.AddTextBox(msoTextOrientationHorizontal, 100000, 1, 20, 10)
    With TextBox
    .TextFrame.Characters.Text = "R"
    .TextFrame.Characters.Font.FontStyle = "Bold"
    .TextFrame.Characters.Font.Name = "Wingdings 2"
    .TextFrame.Characters.Font.Color = 12611584
    .TextFrame.AutoSize = True
    .Top = Cell.Offset(0, 1).Top
    .Left = Cell.Offset(0, 1).Left
    End With
    Next Cell
    Next Worksheet

    End Sub
    Last edited by rakeshplb; 05-30-2009 at 07:42 AM.

  8. #8
    Registered User
    Join Date
    04-05-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Macro to add text box based on cell property

    Can anyone please help me on this.

+ 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