Identifying and denoting based on conditional data

aryaden

Board Regular
Joined
Jun 9, 2021
Messages
101
Office Version
  1. 2019
Platform
  1. Windows
I am quite new to VBA and I am having trouble some trouble creating a macro for this task. Using the example sheet I provided, I need to identify when the column has a "X" in one of the text boxes under each sport listed (Basketball, Soccer, Tennis) and if there is an "X" for that day, I need to put an "X" in the row that the sport is listed in. (I have included an expected output sheet).

I am trying to apply this logic to a much larger excel sheets and I need to do this for about 40 sheets so making a macro would be ideal. The difficulty is that the sports listed differ from sheet to sheet (some have baseball/football and etc.) and the number of text boxes (AAAA, BBBB, CCCC... in the example) under each sport also differ. So I am trying to create a general macro to do this.

This is my example sheet:
Example Sheet.xlsm
ABCDEFG
1Category_DescriptionMondayTuesdayWednesdayThursdayFridaySaturday
2111111
3Basketball
4AAAAXXX
5BBBBXX
6Soccer
7CCCCXX
8DDDDXXXX
9EEEEXX
10Tennis
11FFFFXX
12GGGGXX
Sheet4


I need the output to be:
Example Sheet.xlsm
ABCDEFG
1Category_DescriptionMondayTuesdayWednesdayThursdayFridaySaturday
2111111
3BasketballXXXX
4AAAAXXX
5BBBBXX
6SoccerXXXXX
7CCCCXX
8DDDDXXXX
9EEEEXX
10TennisXXXX
11FFFFXX
12GGGGXX
Sheet2
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
you really shouldn use this layout. Instead enter data as:
BASEBALL, MONDAY, AAAA, X
BASEBALL, WEDNESDAY, AAAA,""
TENNIS, TUESDAY, FFFF,X
etc..

then run a pivot table to summarize the data.
but YOUR way, formula cell B3 would be: =IF(COUNTA(B4:B5)>0,"x","")
 
Upvote 0

Forum statistics

Threads
1,214,962
Messages
6,122,482
Members
449,088
Latest member
Melvetica

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top