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

  • Home
  • SEARCH
  • 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 7536115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:29:17+00:00 2026-05-30T06:29:17+00:00

I was wondering if someone can help me solve the following problem. Someone has

  • 0

I was wondering if someone can help me solve the following problem. Someone has previously helped me on get the % of dctest/In value on the same worksheet. But right now, i need to do the same thing but on a different worksheet.

Say Sheet1

enter image description here

this is copied Sheet1 (1) after taking the %

enter image description here

Sub marco1()

'start making Sheet1 into %
'~~> Add/Remove the text here which you want to ignore
Excludetext = "In,test1,test2,test3,test4,test5,test6"

MyArray = Split(Excludetext, ",")

Set ws = Sheets("Sheet1")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row

'Set Column B into %
For i = 1 To LastRow
    boolContinue = True

    For j = 0 To UBound(MyArray)
        SearchText = UCase(Trim(MyArray(j)))
        If UCase(Trim(ws.Range("A" & i).Value)) = SearchText Then
            boolContinue = False
            Exit For
        End If
    Next j

    If boolContinue = True Then
        With Range("B" & i)
            .Formula = _
            "=OFFSET(INDIRECT(ADDRESS(INDEX(MATCH(A" & i & _
            ",$A$1:$A$45,0),1,0),1,1,1,'Duplicated_Sheet1')),0,1)/$B$5"
            .NumberFormat = "0.00%"
        End With
    End If
Next i
End sub

There is some error showing at the formula, did i make a mistake with the formula? Thank you in advance!

  • 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-05-30T06:29:18+00:00Added an answer on May 30, 2026 at 6:29 am

    Is this what you are trying?

    TRIED AND TESTED

    Option Explicit
    
    Sub Sample()
        Dim ws As Worksheet
        Dim wsData As String
        Dim SearchText As String, Excludetext As String
        Dim LastRow As Long, i As Long, j As Long
        Dim MyArray() As String
        Dim boolContinue As Boolean
    
        '~~> Add/Remove the text here
        Excludetext = "In,Test1,Test2,Test3,Test4,Test5,Test6"
    
        '~~> Change this to the relevant sheetname which has the data
        wsData = "Sheet1"
    
        MyArray = Split(Excludetext, ",")
    
        Set ws = Sheets("Sheet2")
        LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
    
        For i = 1 To LastRow
            boolContinue = True
    
            For j = 0 To UBound(MyArray)
                SearchText = MyArray(j)
                If ws.Range("A" & i).Value = SearchText Then
                    boolContinue = False
                    Exit For
                End If
            Next j
    
            If boolContinue = True Then
                With ws.Range("B" & i)
                    .Formula = _
                    "=OFFSET(INDIRECT(ADDRESS(INDEX(MATCH(A" & i & _
                    "," & wsData & "!$A$1:$A$11,0),1,0),1,1,TRUE,""" & _
                    wsData & """)),0,1)/" & wsData & "!B1"
                    .NumberFormat = "0.00%"
                End With
            End If
        Next i
    End Sub
    

    When using ADDRESS() for a cell in different sheet, you have to specify additional arguments.

    Straight from Excel’s help

    Syntax of ADDRESS Function

    ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text])
    

    Where [sheet_text] is the name of the sheet which we are referring to. I would recommend reading more about it in Excel Help.

    This is the actual formula for say dctest

    =OFFSET(INDIRECT(ADDRESS(INDEX(MATCH(A7,Sheet1!$A$1:$A$11,0),1,0),1,1,TRUE,"Sheet1")),0,1)/Sheet1!B1
    

    HTH

    Sid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if someone can help with this or has had a similar problem.
I have a small problem and wondering if someone can help me out. I'm
wondering if someone could help me, but at the same time hopefully I can
I was wondering if someone can help me, I have the following script that
Just wondering if someone can help me code the following. I want to use
Just wondering if someone can help me with the following issue. I want to
I was wondering if someone can help me out - working on a bit
I was wondering if someone can help me out with this issue. I have
I don't have formal knowledge of continuations, and am wondering if someone can help
I was wondering if someone might be able to help me solve the Lotka-Volterra

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.