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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:34:12+00:00 2026-06-15T10:34:12+00:00

I have a data set for an unrelated classification problem I am going true,

  • 0

I have a data set for an unrelated classification problem I am going true, and I want to cut down on the number of attribute totals. I’ve put my data set into a CSV format which excel handles quite nicely, but I need to make some changes – and I’ve never done any VBA so the syntax seems extremely foreign to me.

Basically, I have 7071 columns (attributes) and 70 rows (instances). Cells below each of the columns (say A75 for column A) contain a certain statistic method for attribute evaluation. What I want to do is check against the value in this cell (“A75” in this example), and if it is below a certain threshold, delete the entire column as well as shift everything to the left. So if I had something like :

o A B C D ... XYZ

1 2 5 4 9 ... 2

2 3 9 0 1 ... 3

3 1 1 5 6 ... 0

...

75 0.23 0.5 0.6 0.44 ... 0.8

And my calculations determined that the minimum threshold is 0.3, then the macro would get rid of column A and shift the others to the left:

o A B C ... XYZ

1 5 4 9 ... 2

2 9 0 1 ... 3

3 1 5 6 ... 0

...

75 0.5 0.6 0.44 ... 0.8

Any help at all would be greatly appreciated.

  • 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-15T10:34:13+00:00Added an answer on June 15, 2026 at 10:34 am

    This should do it for you. If you deleting rows or columns begin deleting from the end and move to the start (ie right to left or bottom to top).

    Option Explicit
    
    Sub RemoveColumns()
        Dim vEvalRange As Variant, ii As Integer
    
        'NOTE: This assumes the usedrange starts at cell A1!
    
        'Screen updating when deleting cells slows things down
        Application.ScreenUpdating = False
    
        'Set your evaluation row to an array.  It's faster to sort through variables than sheet ranges
        vEvalRange = ActiveSheet.Range(ActiveSheet.Cells(ActiveSheet.UsedRange.Rows.Count, 1), ActiveSheet.Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count)).Value
    
        'count from right to left otherwise your columns will shift and mess up your array
        For ii = UBound(vEvalRange, 2) To LBound(vEvalRange, 2) Step -1
            If vEvalRange(1, ii) < 0.3 Then
                ActiveSheet.Columns(ii).Delete
            End If
        Next ii
    
        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 have a large data set and I want to write a custom merge
I have a data set with 1000 observations. I want to only print out
I have a data-set which contains number of tables. I have to accomplish a
i have a data set that resembles the table below. what i want to
I have a data set comprised of 5 minute price observations (not an xts
I have a data set that resembles this: id product_id size color price created_date
I have a data set with over 50,000 geocoded points (lat-long). Each point has
I have a data set which consists of an ID and a matrix (n
I have a data set that is around 700 rows with eight columns of
I have a data set that that I would like to call in a

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.