Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:42:20+00:00 2026-06-15T18:42:20+00:00

I want to enter multiple values in a single cell in excel sheet based

  • 0

I want to enter multiple values in a single cell in excel sheet based on the certain condition as in if there are multiple sheets in the workbook then if any of the sheet starting with name TC contains color in it then I’ve to enter the information in Read Me Section of the Excel Workbook a another worksheet. The problem with my code is that its not displaying unique sheets which contain coloring…Suppose Sheet “TC_1” and “TC_3” contains color in any of the cell then its displaying the output as “;TC_3;TC_3;TC_3;” although the expected output over here is “TC_1;TC_3”.

Here, is the code:

Sub ErrorInSheet()
    Dim Row
    Dim Names As String
    Names = ""

    For Row = 2 To tsheet.UsedRange.Rows.Count
        For Chkcol = 1 To tsheet.UsedRange.Columns.Count
            If tsheet.Cells(Row, Chkcol).Interior.ColorIndex = 3 Then
                Names = Names & ";" & tsheet.Name
            End If
        Next
    Next Row

    Sheets("Read Me").Cells(13, 5).Value = Names

End Sub

Sub iterateSheets()

    For Each sheet1t In Worksheets

       If InStr(1, sheet1t.Name, "TC") Then
           Set tsheet = sheet1t
           Call ErrorInSheet
       End If
    Next
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:42:22+00:00Added an answer on June 15, 2026 at 6:42 pm

    I think this will work for you – I tested it and worked for me.

    Sub FindErrors()
        Dim sht As Worksheet, cl As Range, shtNames As String
    
        shtNames = vbNullString
    
        For Each sht In Worksheets
           If Left$(sht.Name, 2) = "TC" Then
                For Each cl In sht.UsedRange.Cells
                    If cl.Interior.ColorIndex = 3 Then
                        shtNames = IIf(shtNames = vbNullString, sht.Name, shtNames & ";" & sht.Name)
                    End If
                Next cl
           End If
        Next sht
    
        Worksheets("Read Me").Cells(13, 5) = shtNames
    End Sub
    

    Notes:

    1. I’ve explicitly declared the variables
    2. I am assuming all your sheets start with “TC” so I’ve used Left$ but you can use InStr if you like
    3. I’ve used the ternary IIF statement to stop you getting a leading ;
    4. I’ve put all the code in one Sub but you can split it out if you like
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to enter floating point values to some of the record. So if
In my application four TextArea is there and I want to enter only four
I want to add multiple values into an array, but I want to stop
I want to Insert values multiple times like, I have PartNo and Quantity if
Scenario: I want to enter an address (Sweden, Stockholm) into an inputfield and get
I have a text-box, and I want to enter a string in language A
This is a mystery.. in my controller Add function i want to enter the
I want to interpret Enter key as Tab key in whole my WPF application,
I want users to enter a comma-delimited list of logins on the form, to
I am trying to create a list where I want users to enter data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.