+ Reply to Thread
Results 1 to 6 of 6

Do while activecell contains "%Text%"

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Do while activecell contains "%Text%"

    Hi Team,

    I have an excel file which contains multiple payments for a month stacked in a single column wherein each payment has approx 10-11 line items. But each payment starts with a fixed text.

    What I am trying to do is using this term, insert a row on the top in order to seperate each payments for user reference.

    I am using the below codes:

    Sub Format_Text()

    Dim Text As String
    Text = InputBox("Please type the variable factor")

    Range("A1").Select
    Do Until ActiveCell.Value = ""

    Do While ActiveCell.Value = "%Mar%"

    ActiveCell.EntireRow.Select
    Selection.Insert Shift:=xlDown
    Loop

    ActiveCell.Offset(1, 0).Select

    Loop
    End Sub

    However the line "Do While ActiveCell.Value = "%Text%"" should validate if the cell contains the value specified by the user, but its not working as per my expectation.

    Can someone fix this code for me.

    Regards,
    Raghu

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,620

    Re: Do while activecell contains "%Text%"

    Perhaps.
    Please Login or Register  to view this content.
    PS Can you add code tags when posting code?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Do while activecell contains "%Text%"

    Tried using this code but it doesn't work.

    Regards,
    Raghu

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,620

    Re: Do while activecell contains "%Text%"

    Raghu

    'doesn't work' doesn't really help pinpoint what the problem is.

    How doesn't it work?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Do while activecell contains "%Text%"

    Apologies. Should have given more information.

    Attaching a sample file for your reference.

    Regards,
    Raghu
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,620

    Re: Do while activecell contains "%Text%"

    Where exactly do you want to insert rows?

    Does this do what you want?
    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. [SOLVED] If Range("K" & ActiveCell.Row) = "" Then (ERROR)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2013, 04:56 PM
  2. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 AM
  3. How to set the Activecell of "Sheet2" to Activecell of "Sheet1"
    By shawnh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2010, 11:12 PM
  4. Using "text" in activecell.formula
    By peejay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2007, 09:16 PM
  5. Replies: 0
    Last Post: 04-03-2007, 10:26 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