I have some data that is imported into a spreadsheet, and depending on the data file that is imported, certain data will end up in a different column than it will for other files. In my attached sample spreadsheet, the data I am trying to work with is in Column M. As of right now, my VBA code is as follows:
This code takes the various pieces of data in M7 on Sheet1, copies it to B1 on Sheet2, and puts each piece of data in its own column. I then go back to Column M on Sheet1, pull all the rows that have the hexidecimal data in them, and paste them on Sheet2, starting in B2:![]()
Please Login or Register to view this content.
What I now need is a way to do this without specifically referencing Column M. The route I tried to take is that on row 7 in Sheet1, the column before the data that is in row M in my sample sheet will always have the value of "TRIG." So, I have tried to write code that looks for the column after "TRIG" and then does the actions I already have working. I have only tried it for the first segment of code above, and here's what I've tried:![]()
Please Login or Register to view this content.
I know that I am referencing some things wrong (i.e., columns.count looks at every possible column in Excel instead of just the ones that have data), and I need help!! Can someone please help me with this? If so, can you help me incorporate both of the top segments of code into the main loop? Thanks in advance for your help!![]()
Please Login or Register to view this content.
Bookmarks