[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

noko

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 7
Thread images: 1

File: MSEX.jpg (153KB, 678x465px) Image search: [Google]
MSEX.jpg
153KB, 678x465px
Hi all,

I'm looking for /adv/'s finest MS Excel savants who could potentially crack a painfully annoying issue I have been facing on a daily basis. To put it briefly; I work with sets of data on MS Excel on a daily basis and I frequently have to use the CTRL+F solution to find the criteria I am looking for so I can subsequently replace it with another value. Take the following example:

I have two spreadsheets open- A and B. In spreadsheet A I will have to CTRL+F the word 'unknown'. This will give a result which will contain the word unknown (of course) among other information which I require i.e. 'ABCCorpeation;Unknown;ID1234'. I then manually CTRL+C the ID value at the end of this string of information and open up spreadsheet B. I again CTRL+F and instead of searching for 'uknown' in spreadsheet B, I paste my copied ID. Spreadsheet B is a very simple spreadsheet which just contains IDs and names, so when I paste this ID it gives me a single result and in the column beside it, I can copy down the name associated with the ID. I then go back to spreadsheet A and replace the word 'unknown' with this copied name. Then I would move on.

I assume you struggled to read through that cripplingly long-winded description of my task, but that is an issue which I have to laboriously tackle every day. To add to my woes; the spreadsheet 'A' I describe is actually dozens of spreadsheets which I look for the word unknown in and replace with an actual name after matching it with its corresponding ID.

So my big question is; is there any way that this could be conceivably simplified using a several nested functions, because to date I have been struggling to do this or even fathom how to tackle it or what to use. Please /adv/, help this MS Excel goblin ease the pain in his fingers. Any advice would be truly appreciated.
>>
Try stack overflow? /biz/, /sci/?
>>
>>18716013
it would be helpful to see the exact data format

so far it sounds it sounds like sheet A has just one single column and every cell contains 4 values separated by semicolons

if that is indeed the case you should split the one quadruple column of sheet A into 4 columns

then merge all A sheets

then, in the merged sheet, paste the B sheet not below, but "to the right" of what's already there

then sort the rows by ID (ascending or descending. Excel can definitely do this with numbers. I just hope the IDs are all in the same format [zeroes in front or not etc])

then youd just have to make a formula that puts the content of the "name column" on the right into the "name column" on the left for every row. because of the sorting by ID, the matching "name columns" will already be in the same row

hope that helped
>>
>>18716013
Your in good luck lad. Fortunately, the task you are describing is fairly simple to implement using macros. This can bring the task down to seconds, which is probably very desirable to you. I can give you some code to get you started (obviously remove the greater than sign from these. Also note that the ' before a line I'm Visual Basic for Excel indicates the line is a comment):
>Dim varWorkbookA
>Dim varWorkbookB
>Dim varWorkbookAPath
>Dim varWorkbookBPath
>
>varWorkbookA = ActiveWorkbook.Name
>
>varWorkbookBPath = "C:\Path_of_workbook_b"
>
>Workbooks.open varWorkbookBPath
>
>varWorkbookB = ActiveWorkbook.Name
>
>'do a for or while loop
>Workbooks(varWorkbookA).Activate
>'Google code for ctrl f function
>Workbooks(varWorkbookA).Activate
>Range ("A1").PasteSpecial

You'll be best off going to /g/ with this one. It's trivial if you know excel VBA, but if you don't know it, it's a pain to implement
>>
>>18716013
put all the data in one sheet and use an index function with search and replace functions to do it all at once. Bonus points for setting it up to swap data sets in and out.

if you don't know how index functions work then learn those first.
>>
>>18716024
Tried stack overflow to limited avail

>>18716041

Cheers for the breakdown- Unfortunately sheet A contains about 5 columns of data. You were right about the unknown column however, this is essentially 4 values separated by semicolons. There's limited deviation in how they're expressed, but some IDs can look slightly different (can start with SE, or US) followed by the code to express the country domain. I think one key point I have to hammer home is that I cannot realistically merge all of this data into one manipulable spreadsheet.

>>18716054
Thanks for this man, i'll certainly throw it over to /g/. A macro is what I was thinking alright. The only issue I have with this is how a macro might handle an instance where spreadsheet B does not recognize an ID copied for spreadsheet A (this happens on occasion, the ID needs to be requested and is then copied down onto the master spreadsheet B). Would the macro fall over or would it simply ignore the mismatched values- as this could causes issues and rework? I'm a bit of a macro newbie, so some of this goes slightly over my head.
>>
>>18716140
A macro can capture everything. You can create If statements to handle cases where an ID is not found. A possible solution is that for all id's missed, the macro goes to a different tab and creates a running column with the misses. These can then be analyzed by hand, and any patterns found in them can be incorporated into the macro.

Some additional advice, you can sometimes use the Macro Recorder on the developer tab (a hidden tab in Excel) to follow your actions, and then chain these recordings together to build a macro. For example, turn on the recorder, flip to a different workbook, and then flip back to the original workbook, and stop the recording. You should now have some basic code to flip between workbooks. You can keep doing this and possibly make the program you are looking for, or at least help make it a bit
Thread posts: 7
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.