Assign ListBox or CheckBox Selection to Module - excel

I am freshly new to userforms and trying to further streamline an already VB "automated" process through a selection of possible reports I validate on a report-to-report cadence.
The process includes pulling reports from two separate folders, the old reports and the new reports, then validating them per report (by-country). I have this process down in VB script, but I have to constantly change the dates according to the "last pull date" and "new pull date", the countries affected, and the project I am working within.
The idea would be to type in the dates, check off what project I am working on, and then check the countries I will be working within. Below I have outlined the steps to complete.
Select Project (Only a single selection allowed)
Select Country Report (Multi-Selection)
Type last pull date to navigate to last pull directory folder format.("yyyy-mm-dd")
Type new pull date to navigate to new pull directory folder format.("yyyy-mm-dd")
Example:
Projects-- in single selected listbox
A , B , C (I choose B)
Countries -- can be a multi-selection listbox or can be checkboxes
AR, BR, CA, SA, WD (I choose BR, CA, & WD)
Last Pull Date -- typed in
2019-06-23
New Pull Date -- typed in
2019-11-07
--> Question: How do you assign the variables selected in steps 1-4 to be entered dynamically into a subprocess? The list i believe i can get down, but how do I assign the check list to a variant and then to a variable within a subprocess to be executed?

Related

Reconciliation between Sharepoint List and monthly excel file uploaded to Sharepoint

I am quite new to power apps and trying to determine the best course of action for my below scenario. I want to identify which users submitted to List A and which haven't based on each new monthly file.
I have a List(List A) on Sharepoint I created where users go in and input information, I want to come up with a list of users who have submitted to this list.
I want to reconcile with this monthly file excel that is dropped into a sharepoint link by another user with updated information. So essentially it would be doing a Vlookup into List A to determine who has submitted a record. .
So what I have done:
Created List B manually (from the excel file dropped)
using Power automate/Flow do a vlookup from List B to A whenever a record is created in A.
I created a column in List B that is not within the standard excel file (Column name Submitted, answers would be either Yes/No based on the vlookup) , Vlookup is something like if A.ProjectID = B.ProjectID then B.Submitted = Yes otherwise No.
Problem:
What are my options to get around the fact this file is uploaded monthly? I dont want to recreate List B each month and have to setup the "Submitted" Column each time. I want this to work in an automated fashion.
Some Questions/Ideas:
Is there a way I can overwrite List B and keep the "Submitted" column each month automatically? It is dropped into a new folder each month on SP. ie "Aug 2021" , "Sept 2021", etc.
Can I do the recon in the sharepoint excel file itself automatically each month? Ie When the excel file is created run a macro to create the new column and do a vlookup?
Can a 3rd List be created as some master tracker page to hold all project status'?
Any ideas or suggestions are welcome. Looking for the best way on how to do this. Thanks
I think you should approach this from PowerAutomate.
I'd start off by creating a flow with a SharePoint trigger to catch when the Excel file is uploaded.
You should then get the content from the Excel with Excel Online / List Rows in a Table
Use 'Apply to Each' to loop over each user in the table. Inside the loop do the lookup.
Write back the result to the Excel with Excel Online / Update a Row action.
I'd recommend you create a separate thread for the project master list problem and elaborate your goals thereto.

How to use mailmerge macro from excel to word with a click of a button in the excel sheet

I am trying to create a code which will be executed with a click of a button in the excel sheet and will ask me for an input of a cell value in excel which will then take all the data from that cell's row and insert it accordingly in the word template where the mail merge tags are.
for example :
I have data like this in my excel sheet :
ID(A1), Name(B1), Last Name(C1), Country(D1), Date(E1)
378232625(A2), John(B2), Smith(C2), United States(D2), 29/02/2020(E2)
322783145(A3), Joshua(B3), Brand(C3), United States(D3), 27/02/2020(E3)
I want to have a button which will ask for an ID input and will then take all the other info of that person and place it in the word template in the correct place.
For example:
When a user runs the code it will pop up an input box and it will ask him to type an ID,
for example: 322783145
it will then check where the ID is placed(which row in A column) in the excel sheet which is A3 for this example and will pull the rest of this person's information into the word template I have created beforehand.(ID, Name, Last Name, Country and Date).
Later on I want to be able to automatically save it to pdf as well with the same button but first I want this to work.
Thanks in advance :D
You don't need VBA for this with the question as originally posted - simply use a SKIPIF field coded as:
{SKIPIF{MERGEFIELD ID}<> {FILLIN "Which ID do you want?" \o}}
or:
{SKIPIF«ID»<> {FILLIN "Which ID do you want?" \o}}
where 'ID' is the name of the data field in Excel you want to the merge to process.
With that, only the record containing that ID will be processed. No VBA required.
Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. Likewise, the chevrons (i.e. '« »') are part of the actual mergefields - which you can insert from the 'Insert Merge Field' dropdown (i.e. you can't type or copy & paste them from this message, either). The spaces represented in the field constructions are all required.
I see that you've added two new requirements, viz:
the mailmerge to be run from a button in Excel; and
for it "to be able to automatically save it to pdf as well".
You really shouldn't move the goal posts this way. Nor should you ask ask multiple distinct questions in the same thread. For code to run a merge from Excel (and send the output to PDF), see Run a Mailmerge from Excel, Sending the Output to Individual Files in the Mailmerge Tips & Tricks thread at: https://www.msofficeforums.com/mail-merge/21803-mailmerge-tips-tricks.html. Of course, once you get into using a macro such as this, you will need to add the logic for the ID selection to that code. Ask in a separate thread if you can't figure that out.

How would I write code for a UserForm that would allow user to select what row and/or column information could be added or deleted

I am an Advanced Emergency Medical Technician and am trying to make a user friendly excel workbook to keep track of our inventory on our Ambulance. I want to be able to allow users to add new items to a specific cell range or delete items from specific cell ranges by using a form only as some of the individuals I work with are no were savvy with excel. I would potentially a have sheet with items from every cupboard and at the bottom of every cupboard list have a button that would open a userform that would allow items within a specified named range to be deleted or new items to be added based on a user selecting something like place item above or below the row of an item they have selected. I am currently working from scratch on this one as I cant find anything to even start with.

data validation list if cel in table contains

I have created an excel file to keep record of worked hours and revenue for each customer and each employee, also i created a sheet with projects for each customer that also keeps record of the total worked hours per project etc.
I create a project and choose the customer (Sheet 2)
I go back to my hour registration sheet and set the starting time and choose the customer from a dropdown menu (Sheet 1; A2) (data validation)
Then i would like to filter the second cel (Sheet 1; B2) with a dropdown menu containing the projects so it only shows projects for that specific customer.
When i finish a project i mark the project as finished by choosing "Yes" in the last cel of the row. (Sheet 2)
Then i would like the project dropdown menu to also filter the finished projects. (IF="Yes" dont show on data validation)
I've tried all kinds but nothing works with my current setup.
Any suggestions?
Are you using some kind of VBA or doing it through Formulas? if you are using vba then show the code here.

Report depend on SharePoint list

I have simple list in SharePoint just contain Task name,From,to and percent value
where I could assign some task to other one and each week he should update the percent of complete value.
The task maybe take 5-6 weeks So I need a report to know in current week for example which user update his task and the old value and the new value he change.
So I need away to have such report where I could set from date to date and it report which task is changed by who and the changed value.
I'm using normal list in SharePoint 2010.
You can achieve it this way:
1. Create another column in your list (I call it OriginalList) called PreviousPercentValue and set its default value to [Percent Value]
2. Create another list (for example Reports) with columns: [Previous Percent Value], [Current Percent Value]
3. In Reports, add two additional columns to the default view: Created, Created By
4. Create a workflow in SharePoint Designer on OriginalList, activated on modification, that will check if PreviousPrecentValue is different than [Percent Value] and if yes, then:
a) Create a new item in Reports with values: Reports.[Previous Percent Value]=OriginalList.PreviousPercentValue, Reports.[Current Percent Value] = OriginalList.[Percent Value].[Created] and [Created By] will be set automatically for you. I am not sure if [Created By] will be set properly, if not then create another column in Reports called User and in the workflow, set its value to OriginalList.[Modified By]
b) Set OriginalList.PreviousPercentValue to OriginalList.[Percent Value]
This way, every record in your new list Reports will have data you need: who, when, old + new percent values. You can add views on Reports to customize data you want to see.

Resources