VBA or Function - have a select range of columns in a row following a reference cell?

tzcoding

New Member
Joined
Mar 17, 2023
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Is there a way in excel to have a select range of columns in a row following a reference cell?

Situation: I have a set range that is part of a data pull and populates information off a reference ID# that I pull in from a data set. The downside is that I have some manual cells that I use for user input that i also need to follow that reference ID#.

Example: I have the reference ID# in column "A: A" and column "B: E" all autofill the rows as long as the reference ID# in the data pull match column "A: A." However, columns "F: J" are all user input and will not follow the reference ID# in Column "A: A. "Witch causes conflict when validating information. I need the rows in column "F: J" to follow the rest of the rows that are auto-filling to columns "A: A" reference ID#.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I think it would be helpful if you could show us an example of that you are trying to do.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Here is a better visual example that might help explain what I am trying to do.

Columns A:D are populated by a Teradata pull, Columns H: I are user input, and finally, Columns F: G check if the two match. Usually, Column F would be hidden in this situation. I added text to the image, but the issue is that as the Teradata refreshes and more information are loaded in columns A:D, then columns H: I stop matching. This is because the Teradata pushes the info down in the hierarchy, so the new information is at the top of the row.

My help need is that I need the information if H: I to follow the Teradata information so that the user inputs match appropriately to the correct reference ID#



2023-03-28 06_39_31-Start.png
 
Upvote 0
It seems like a design flaw to me.
You should really not be matching on row number, especially since the data will not always line up, as you have shown.
Rather, you should be matching between the two lists based on the ID#, using formula like VLOOKUP, XLOOKUP, or INDEX/MATCH.

Quite frankly, what you have is a "relational database", and would work much better in a relational database program, like Microsoft Access or SQL.
Then you would just "join" your two tables on your ID field, and it is easy to bring it all together in a simple query.
You can also do those kind of database operations in Excel if you use Power Query. So you may want to consider looking into that too.
 
Upvote 1
Solution

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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