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 9235715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:07:04+00:00 2026-06-18T07:07:04+00:00

I am working on a way to generate a list based on the value

  • 0

I am working on a way to generate a list based on the value of each row in a given column (G). Currently the list can copy entire rows and works perfectly. It pulls all rows if column G contains the required text (“Card”) and puts them in a list on another spreadsheet with no gaps.

The problem is that I want the list to only contain information from a few columns in each row containing “Card”, not the whole row.

Is there a way to make my code below pull specific cells from a row rather than using the .EntireRow function and copy the whole row?

To clarify, this spreadsheet is updated regularly by multiple different users so the information is not static. Rows are added and changed frequently and occasionally deleted. As such I cannot just copy cell values from the original sheet to the new list.

Sub AlonsoApprovedList()

  Dim cell As Range

  Dim NewRange As Range

  Dim MyCount As Long

  Dim ExistCount As Long

  ExistCount = 0

  MyCount = 1

'----For every cell in row G on the ESI Project Data sheet----'

  For Each cell In Worksheets("ESI Project Data").Range("G6:G5000")

  If cell.Value = "Card" Then

      ExistCount = ExistCount + 1

      If MyCount = 1 Then Set NewRange = cell.Offset(0, -1)

      '----Sets up a new range to copy all data from the row if column G in that row contains the value in question----'

      Set NewRange = Application.Union(NewRange, cell.EntireRow)

      MyCount = MyCount + 1

  End If

  Next cell

  If ExistCount > 0 Then

      NewRange.Copy Destination:=Worksheets("Alonso Approved List").Range("A3")

  End If

End Sub

Additional information:

  1. Column G drop down data validation lists containing one several
    items. A complete list is in a different worksheet. Users go in to
    each line item and select from a specific category.

  2. The other columns in question contain a line item’s name, category
    (same as column G), a monetary value, and a date.

  3. The code above loops through a list in the “ESI Project Data” Worksheet and detects rows by the value in cell G. It currently copies the whole row every time a key word is in cell G (“Card”) in this example. I am using it to generate individual lists grouped by that key word. I just want it to pull individual cells, not use the .EntireRow function as it currently does. I do not know how to do that.

Thank you for your time!

  • 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-18T07:07:05+00:00Added an answer on June 18, 2026 at 7:07 am

    Untested…

    Sub AlonsoApprovedList()
    
    Dim cell As Range
    Dim rngDest As Range
    Dim i As Long
    Dim arrColsToCopy
    
        arrColsToCopy = Array(1, 3, 4, 5)
        '----For every cell in row G on the ESI Project Data sheet----'
        Set rngDest = Worksheets("Alonso Approved List").Range("A3")
    
        Application.ScreenUpdating = False
    
        For Each cell In Worksheets("ESI Project Data").Range("G6:G5000").Cells
    
            If cell.Value = "Card" Then
    
                For i = LBound(arrColsToCopy) To UBound(arrColsToCopy)
                    With cell.EntireRow
                        .Cells(arrColsToCopy(i)).Copy rngDest.Offset(0, i)
                    End With
                Next i
    
                Set rngDest = rngDest.Offset(1, 0) 'next destination row
    
            End If
    
        Next cell
    
        Application.ScreenUpdating = True
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't find i smooth 100% working way to keep my app in the
I'm working on an application (ASP.NET, Webforms) that generates a list of outputs based
rails newbie here. I've started making a value based to-do list. So far I've
While working my way through the Android tutorials, I came across something I don't
I'm working my way through "Learning jQuery" (Third Edition). In Chapter 4: "Manipulating the
I'm working my way through displaying various data elements from parent & child data,
I'm working my way around the SOS commands and their output, but I noticed
I'm working my way through some ASP.NET MVC reading and I have a web
I'm working my way through Agile Web Development with Rails and am running into
I'm still working my way through some pretty basic Actionscript programming (in Flex), and

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.