(Excel-VBA) Specific data import (on the background) in the active sheet - vba

Would you please help me (total beginner) to prepare a VBA macro that would open a sheet on the background and import specific selection as shown below:
Let's say we have downloaded wordcount analysis (xlsx) like this downloaded from a CAT tool for testing.
Now I would need to add a macro to my main sheet that would read lines starting (Column A) with "All". If "All" then I'd need to record columns of that line (specficilly Columns A - O) in array / hashtable?.
Please take a look at this image that summs it all (better than explaining it for me :-)
Let me know in case you need to know more details.
All tips / suggestions are greatly appreciated.
Many thanks!

My suggestion (I'm a beginner too) would be to use the Macro Recorder. Great tool to learn (example).
start recording
filter for 'ALL'
copy/past the Cells
stop Recording
Then have a look at the recorded code and adjust it :)

Looking at your data and the final layout you are looking for, using a Pivot Table would provide you with all of the flexibility you need.
You can:
filter which data to display
generate calculated values based on data in other columns
choose what order your columns are displayed
dynamically change the layout if you decide you want a different view
From your data, I was able to generate the following Pivot Table in about 15 minutes.
There are several good, simple tutorials on building Pivot Tables. A Google search will turn up plenty.
Things you will need to learn about for your particular problem:
Classic display (I used the classic display to get this particular layout)
Calculated Fields (many of the columns in the pivot table are calculated based on your spec). There is a maximum string length of 255 characters for a field calculation, so you may need to rename some of the columns in the original data set.
Of course, basics of Pivot Tables
Loading new data and updating your pivot table
Good Luck!

Related

Dictionary vs pivot Table and some office issues

In company when I currently work we have big issue with MS excel stability, hence my question below.
Recently I just learned about excel Dictonary code.
I know pivot tables and how they work.
sadly the issue is not with pivot themselves but with excel. (IT dept. is working on the issue for 3 weeks now, and we dont know when / if they gonna fix it)
Hence my big ask for thi community:
I would need a userform working with the dictonary.
What I would need is to create a code that could work as pivot table but using dictonaries (since theoreticaly they are faster and are outside of VBA / excel basic in-build option)
so?
Can some1 help in creating such code?
Is this the right option?
I would like to see a userform where I can choose my Table(ctrl+T) headers to choose by which header i want to sum values up, and ofc I would have to be able to choose a column by which the dictonary summing is working on.
Thank you both for answering.
Lets start then.
I watched ExcelMacroMastery videos regarding dictionaries,
In this example, he used them to make a basic sum exactly like the basic functionality of Pivot table.
So since that's the basic use where I work I wish to have a dictionary macro from which I can choose the column by which I get unique values and 2nd column with a sum from the second provided column from a table.
the issue is: if I show any file or any example this could result in macro working for this specific case, and I would like it to be able to choose by Table's (CTRL+T) headers for the unique values and to use some way(like a dropdown menu) to choose the column by which the sum can happen.
This instability is due to 32 bit office suite 365 working n 64 bi PCs/ laptops and recent company update made it even worse, now there is an issue with even basic save file option.
Not to mention excel crashing for no apparent reason.
So to sum up,
I need dictionaries to kinda step up and replace basic summarizing functionality of an pivot table.
or to replace this non pivot way:
use unique function to determine unique values from specified column (non-table object sadly)
Use sumif or sumoifs function to summarize the specified amount/value for that unique list.
//EDIT:
I kinda found what I was looking for thus the edit.
Im showing the link to the file I wish to change a bit:
https://app.monstercampaigns.com/c/s0iavndiopijkrar8ghp/
to this file I wish to add a user form by which the headers of the report will be chosen from source data, and by which the sum will occur.

Get result like Excel Pivot Table in BigQuery

I'm trying to get a result like this.
And I have this table right now
Can anyone help me out?
I'd like to get this table by refreshing every day so I can keep up with the result.
Thanks in advance and any help will be warmly welcomed :D
While there are quite a number of pivot related posts on SO and good number of answers are provided by myself and other experts (so you might just need to search more on site), I wanted to share not-trivial option you have to do Excel style pivot right in BigQuery UI without any extra coding.
This can be useful when you have flattened data like in your example - but you need quickly visualize it w/o leaving BigQuery UI
For this to work you need to use Chrome Extension BigQuery Mate (as you can see from my profile I am an author/developer of it)
So, when you have it installed - follow below steps
Make sure you select needed data into result panel as below (i just generate random values to mimic your scenario)
Expand Result Panel by clicking on green + button - now you can see up to 500 rows
Click green Show Pivot button to generate Graph / Pivot from those visible (up to 500) rows of data
Finally, set / tune your pivot / graph as per your needs / preferences - for example as below
To go back to normal UI state - click on Hide Pivot and then -- button

Displaying rows based on column label in Excel for a Pivot Table

I'm facing the following problem. I have a very large excel sheet in the format attached as a picture. For reasons beyond my control the basic formatting of this sheet needs to be maintained as people with no skill want to be able to edit this.
However, I need to work with the content and as it is quite large, it is really unreadable. So what I wanted to do is to be able to find the tasks belonging to different departments and the different people. My approach was to create two pivot tables where I want a dropdown list with either the department or the person to be able to filter on the tasks that that belong to each of them. I have found how to filter on a dropdown menu, however this is for column entries. What I want to do is to filter on the column labels and then display the tasks for which the column I selected is non empty.
I need some help on the direction in which I need to search for the answer to this problem as I'm currently lost in solutions that have nothing to do with this problem.
Thanks in advance
You can use Power Query Excel 2010+ you can download and activate easily or by default in 2016 version. There you can keep this format for your users and a pivot table for control.

extract data in exel sheet using macro

you most probably going to think "what an idiot" but remember i never done any type of coding before so this is all new to me,
My problem are that i'm working on a HUGE excel sheet with loads of data that is not needed. i need to sort the data into a few columns, i only need column "A,K,AN,AQ" but in column "AS" i only need certain values (yes,no,blank) i only want the yes and blank values. like i said never done any coding before but i know that you can use an macro to do it so please help, how do i go about this?
before trying to get into macros, try to use functions with if else statements. They are quite easy to handle. Like: If (yes) then put it into X. Later, you could select all needed. Also, check the, how the dollar sign is used
use this links to see, if it is something for you.
One quick and dirty way of getting this job done would be to:
Delete the columns you don't need.
Select all cells in the range you're interested in, click the Insert menu, and choose "Table". If your columns have titles, select the box for "My Table has Headers."
-This turns your data into an array so that Excel recognizes that each row is an entry (instead of thinking that the cells are unrelated).
Now you can use the filter icon in the column headers to select and display only the rows containing the values in column X that you're interested in.
Note that there are some limitations to what the table feature is good for, so, as always, whether this is a good solution for you depends on what you want to do with the data.

Filter certain SQL data formatted in one column into a new column

Before I begin I found this to be most relevant with the research I have done.
How to split the data from one column into separate columns using the contents of another column in SQL
Attached are pictures of my progress so far. How can I display this information such as it is shown in the excel file without disrupting the GROUP BY filter in my Query?
It's a Fishbowl Database, newest version. I am running the queries through Flamerobin which you see in the picture. Trying to organize the query to display correctly so I can format it into 'iReports' and export it into an excel spreadsheet like the one shown. Maybe there is some part of this that would better be done in excel?
Notice the numbers for Qty are different, that's ok right now.
My reputation is too low to post pictures I am sorry. Here are the two JPGs in my Dropbox. I really appreciate the help.
https://www.dropbox.com/sh/r2rw5r2awsyvzs9/AAAXXg27CMPOYtZFqPX3Dx6la?dl=0