Questions tagged [excel]

Microsoft Excel is a commercial spreadsheet application written and distributed by Microsoft.

Filter by
Sorted by
Tagged with
2
votes
1answer
246 views

Opening a specific Outlook item quickly

I have this code to open an outlook appointment item: ...
2
votes
1answer
59 views

Loop with multiple conditions that need to be true, across two different sheets

I've written some code in Excel VBA that does the following: Finds a cell ("O") in a range (C3 to Z26) Looks at an adjacent cell. This cell is located through "OFFSET_ROW" and "OFFSET_COLUMN" (...
3
votes
2answers
74 views

Modifying shapes in a group of shapes

The code is going through a series of shapes inside a group of shapes. The grpvariable is set as a Public shape variable earlier in the process of selecting the ...
6
votes
2answers
205 views

Create a 2 way mapping to allow you to stringify enums or map one enum to another

I've created a class that creates key->value pairs but also value->key pairs - i.e. a reversible hash-map. This is because I want to be able to switch between corresponding members of 2 enums ...
2
votes
1answer
295 views

read an excel that contains population data of counties and compute summaries by state, county

As part of the exercise in the book "Automate the boring stuff with Python" chapter 13 on Excel, I had the following exercise: Reads the data from the Excel spreadsheet Counts the number of census ...
1
vote
1answer
41 views

Populates Data from one Workbook to Another

Another code clean up I am working on. I have been breaking up my code based on things I have learned here on CR. The code below all works and functions as expected, but I know it can be streamlined ...
3
votes
1answer
84 views

Utilize loop or other efficient way to find string and copy offset columns to certain cells

I am trying to find certain strings in MasterSheet and copy offset columns (3 columns) values in the specific columns in receiver sheet. So far i have this code doing exactly what i want to do ...
4
votes
2answers
87 views

Sequence Generator from previous max sequence based on certain conditions

I'm new to VBA programming so the following code may look terrible which is why I want ways to understand how to better optimize it and other future codes. ...
6
votes
1answer
156 views

Copying strings from files into a new Excel sheet

My code here loops through my folder and my files inside the folder and use .find and copy the strings into a new Excel sheet and then with all the data in the new ...
1
vote
2answers
109 views

Reduce time taken for VBA loop when copying multiple sets of input values, performing Excel formula calculations and recording results

My VBA code currently loops for 5,000 iterations and takes about 25 minutes to collect the output data in the Output excel sheet. Is there a way to reduce the time taken for instance by improving the ...
2
votes
1answer
97 views

VBA More effective way of data trimming

My code consists of Split, Mid, Left, Right and ...
2
votes
1answer
137 views

Add items to Dictionary from another dictionary on cell value change

I have created a very simple Class Module and a Dictionary to store original values when the workbook is opened as part of this project ive been working on. When the workbook opens I call a test to ...
3
votes
2answers
69 views

Worksheet_Change Event Sends Email

I have functioning code that I wrote what seems like a long time ago in a Worksheet_Change event, and even though this works I'm sure that it can be written better. ...
0
votes
1answer
99 views

Copying data from a "master" sheet onto multiple "detail" sheets

I'm new to using VBA. What I'm working on is to copy details from a master file to multiple sheets within a worksheet. I'm facing a performance problem when I run my code, my Excel file keeps ...
5
votes
2answers
133 views

VBA Workbook to automate e-mail delivery

I started learning VBA for an internship, 3 months ago. This is the last project I have worked on. It does all the tasks it has to do, it's all about code review. I will be grateful for all ...
1
vote
1answer
98 views

Comparing information to a directory of active enployees

The code is doing everything that I need it to. It's taking much too long though upwards of a couple minutes to complete the macro. Does anyone know how I code optimize this VBA code to run quicker? I'...
3
votes
2answers
92 views

Inherited Code - Worksheet_Change Event Code

I inherited this code and have to fix it. It does work and I know I can refactor the code using If Not Intersect(Target, Me.Range()) Is Nothing Then syntax. I am ...
3
votes
1answer
89 views

Dynamically create ordered list in outlook from Excel

I have working code for this project, but I am now in need of some help to create a dynamic ordered list within Outlook from Excel. I am trying to format comments that a user will enter into a ...
5
votes
1answer
633 views

Mapping Excel rows to model

I have an Excel file and each row within the sheet represents an employee's data. I am trying to find a cleaner way to map each row to a model object: ...
1
vote
1answer
160 views

excel vba discrete random variable udf

I am working on writing a discrete random variable generator function in excel vba. I've pulled this off a number of ways but here is the one I like the most. Imagine in excel we have the following ...
2
votes
1answer
781 views

Excel VBA code that writes to a Table - much slower than writing to a simple range

I have a piece of code (below) that checks a data table (45,000 rows) to see if the row matches any entries in a range elsewhere on the workbook (using custom functions). The routine then creates an ...
3
votes
1answer
138 views

VBA and SQL to return SQL results to Excel

Now that I finally have time to look back at this code I wrote over a year ago. I need help with streamlining the code I have written. I had to write a significant amount of ...
2
votes
0answers
60 views

E-Mail Automatisation Project with smtplib but did not use MIMEMultipart

The goal of the project is to automate sending the same e-mail to a list of people with the same text (except the salutation "Dear Name of Person") with an HTML signature and a PDF attachment. For ...
2
votes
3answers
373 views

excel vba udf: entire column as fn parameter

I have a function that accepts a range as an input. It works fine when I supply the function with a range like a1:a5, but not when I use an entire column like a:a. I could always loop over the whole ...
4
votes
1answer
160 views

OOP Dependency inversion principle VBA

I've reproduced the example of this video where dependency inversion principle is explained by Tim Corey based on C# I had some trouble understanding the scope of the Logger and MessageSender ...
3
votes
0answers
27 views

Speeding up a complex array function in excel

I have a complex array function that takes way too much time to calculate, which is why I'm looking for ways to make it more efficient. Basically, I have a transaction sheet in which I list all goods ...
1
vote
1answer
71 views

Remove row when everything in the row is same

I have a code that will delete the row if the entire row is exactly the same. So if in row 1 I have 100,200,300,400,500,600 in column A,B,C,D,E,F respectively, and in row 3 I have the same thing, it ...
5
votes
1answer
135 views

Manage Excel Styles with VBA OOP Approach (Follow up)

This is a follow up to this question Code incorporates Mathieu's comments and it works. As some parts of the review left some code to my knowledge, I ask for another review to see if I implemented ...
5
votes
1answer
129 views

Manage Excel Styles with VBA OOP Approach

I want to manage the Excel Styles in a more flexible way with bulk actions and at the same time improve my newly acquired OOP concepts. Objectives: Load the current Styles list (name and type=...
1
vote
1answer
75 views

Changing all comments' size in range to autosize

I have a code that turns all comments size to autosize, however as I have quite a few cells with comments, this code runs a little slow, to the point where it will become non responsive for awhile. <...
2
votes
0answers
76 views

Intersect Method Slows Down Code In Large Selection Of Cells

I have picture in certain cells. When I run following code (With Intersect Method) in smaller number of selected cells, it runs correctly but when the number of selected cells increase - say above ...
2
votes
1answer
69 views

Sluggish Performance when using ranges from two workbooks to update the one

I'm hoping someone can help me here, I'm working with a file which has about 38000 rows and 180 columns. I'm using a macro to update the fields in the one workbook with the values in the other ...
5
votes
1answer
80 views

Fetch, plot, and send security incident statistics with Excel

TLDR: I don't develop for a living. If someone could point me in the right direction to make my script more readable/pythonic I would appreciate the assistance. In particular I'm struggling with the ...
1
vote
0answers
27 views

Spreadsheet to increment two levels of data indices

I'm posting this after reviewing the Meta Q&A, Non-code formula spreadsheet, and I believe I've got something here that meets the criteria there. Edit: I've added documentation of the formulas ...
4
votes
1answer
75 views

Excel Import Data from Different Workbook Dynamic Headers

I have this code below that copies data into a master workbook, in sheets "Inputs1", by matching the column headers from the master workbook with the source workbook. If a column header matches, it ...
3
votes
2answers
165 views

Persisting Variables Over A State Loss

In an application that I built recently, I needed to persist several variables, without loosing their state, for duration that the application was in use. After some research, I found this post on ...
11
votes
1answer
119 views

Recursive code to generate a parametric sweep of input values

I generate a set of data based off every combination of inputs. The source range that's inputs requires headers to identify the parameters. In its present state I'm not content as it's not as ...
0
votes
1answer
2k views

VBA Excel Looping through recordset and storing the data to use later

I have a loop to add Recordset items to a Dictionary so I can do comparisons and retrieve specific data later in the code (not ...
13
votes
1answer
716 views

Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
2
votes
0answers
100 views

VBA code to account for multiple users too heavy on save actions

I have a worksheet I use with a small handful of colleagues on a daily basis to share information with about orders we place. To make sure we always have the same up to date info we use a shared excel ...
1
vote
0answers
52 views

Copy Non-continuous Cell Values

Backstory: I'm creating department level workbooks that contains director-level information, so I can't use a single workbook (as easy as it would make this). I need to split (and combine) 4 workbooks ...
0
votes
0answers
35 views

Performance of ID's checking between Access and Excel

I want to increase the performance of this code: ...
5
votes
1answer
8k views

Python List of Dictionaries to XLS

How may I optimize the following function to write a xls file from a list of dictionaries using the openpyxl library in Python? The current logic behind feels very very wrong The dict list: ...
0
votes
1answer
74 views

Excel VBA Sub Routine is extremely Slow deleting a Range [closed]

The following script is very slow and I'm not sure why. The script works so if you copy and paste its a typo in the question. ...
1
vote
0answers
93 views

Using arrays instead of regular loops

I have a working code and it works fine for small amounts of data ...
2
votes
1answer
679 views

Populate list with Excel range and keep formatting

I have written a Python programme that takes data from Excel sheets and adds this data to new .DAT files. I use win32com.client because the Excel sheets will ...
1
vote
1answer
65 views

Look for existing pivottables and change date/year colums based off the “Value” filter

We have a macro that updates all dates/years in all our pivottables (around 100 of them pulling out data from our OLAP cube) based off of a "Master Date" at the top of our sheet (which is being ...
3
votes
1answer
66 views

Import Excel sheet into MySQL

This is the first project I have coded using Python. Therefore, I am looking for someone to give me some comments to further improve my code. Purpose of the application This application help the ...
6
votes
1answer
301 views

Excel's Dynamic Array Functions...In VBA (No Win 32)

In recent months I have been trying to figure out how in the world one can mimic the functionality of Excel's New Dynamic Arrays exclusively in ...
1
vote
1answer
944 views

VBA loop optimization

Hi folks: I posted a SO (https://stackoverflow.com/questions/57541246/optimizing-vba-function-loop) and was told to ask here. I am starting to think that rather than relay on excel as my data ...

1 2 3
4
5
22