Skip to main content

Questions tagged [vba]

Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question. Good questions on VBA generally contain some code and asks for solution of specific issues. Questions asking for entire solutions (please give me the code / how to do this and this with VBA) are off topic and will be closed as too broad.

Filter by
Sorted by
Tagged with
0 votes
0 answers
67 views

Error in duplicate record in Access 2010 [duplicate]

I should work with a database into the Access 2010 recently. It has few Tables, a few Queries based on their tables and finally a Form. The Form has a button for duplication records. When I click the ...
Kasy's user avatar
  • 1
1 vote
1 answer
4k views

Excel VBA - add date and time to a file name as FILENAME_MMDDYY_HHMMSS

A few weeks ago I posted about using VBA To prompt me to add a file name when saving an excel file using a macro. Thank you for all the help. I got it to work!! Now I have another similar question. ...
Kirk Thompson's user avatar
0 votes
0 answers
4k views

don't want to automatically add "@" symbol in excel formula

I am adding a formula using VBA in a excel cell and excel automatically adding a "@" symbol after the "=" sign. this is the vba code. It is putting the whole string as formula but ...
Ayan Bhunia's user avatar
0 votes
2 answers
60 views

Cut entire cell, based on specific text in cell, and paste to new cell

I have a six-column table in excel that I am using with a barcode scanner. We are scanning custom QR codes that display text into each cell. The scan starts with scanning the employee's QR code on ...
btwolfe's user avatar
3 votes
1 answer
488 views

How to cross join in Excel VBA

I want to cross join two columns from a sheet and paste the result in another sheet using VBA. Cross join of column A and B from Sheet1 and paste result into Sheet2. I found two answers but not able ...
Ayan Bhunia's user avatar
0 votes
1 answer
95 views

Change text color of URL in Word VBA

After the URL is displayed beside the hyperlink, the formatting from the hyperlink is applied. Is there a way to remove the blue, bolding and underline formatting for the URL. Current format: My ...
Dingleberry's user avatar
0 votes
1 answer
111 views

look for empty cell between non empty cells in one row and then put 0

enter image description here enter image description here A B C abc 30 40 def 4646 ghi 45 3234 So, I want to write a macro code where it takes all three columns into consideration at once....
Aadya's user avatar
  • 1
0 votes
2 answers
285 views

Insert URLs in plaintext after each hyperlink in MS Word using VBA

I would like to automatically insert the URL for each hyperlink in a word document beside the linked text. For example instead of having: my hyperlinked text It should be: my hyperlinked text (https://...
Dingleberry's user avatar
0 votes
1 answer
1k views

Set default zoom in Excel on a new sheet

I have set zoom level when new workbook is open with this code: Private Sub Workbook_Open() ActiveWindow.Zoom = 109 End Sub How to I set custom zoom on every new sheet that's created in that ...
IGRACH's user avatar
  • 499
1 vote
1 answer
244 views

How to fix vba type mismatch?

I have a compile error message byref argument type mismatch pointing to rg1 where the HTML is. Could you please help? Sub email_multi_ranges() Dim OutApp As Object Dim OutMail As Object Dim rgl As ...
tammy's user avatar
  • 13
0 votes
0 answers
223 views

VBA: Compile Error: Syntax Error when trying to use Cell.Replace VBA code

Hi I'm new to VBA and I've created a code to format my Table however I receive an error "Compile Error: Syntax Error" when trying to run it. I have tried to look at the code but I can't seem ...
slimbu2020's user avatar
0 votes
1 answer
357 views

Excel: Extracting the row name and column name corresponding to the MAX value in my DataTable

In cell K1=MAX(J7:AM36) I have the maximum value of the data table, I want to extract the corresponding StopLoss% ( This is my column headers, they are %) to Cell K2 and also my TakeProfit% ( This is ...
Steven's user avatar
  • 3
0 votes
0 answers
108 views

cannot find next item in findNext loop

I loop through Items in an array raArray which I want to find in a Table. However, I cannot seem to get the code to work to find the next result for the array element with FindNext. Either I get stuck ...
user1769136's user avatar
0 votes
1 answer
495 views

Update a field in other records based on the value of same field in a record automatically

I want to transfer the contents (value) of a field in an Access form by VBA to its previous and next records, while I am still in the current record. Could be said I want to copy it to the same field ...
Kasra's user avatar
  • 39
0 votes
1 answer
41 views

continue searching for string in Table until no more results are found then go to next search term

I have a working code that allows me to find a string in a table and returns the value of an adjacent cell (adopted from a different code) and writes it to an array Dim raArray As Range Dim iC As Long ...
user1769136's user avatar
0 votes
0 answers
21 views

write avg subtotal in filtered list "in-line" with month

I have a list of values, where want to calculate the average for each month based on the subtotal(101) function. Each month has a different amount of values (e.g. 5 values for March, 17 for July). (...
user1769136's user avatar
1 vote
1 answer
76 views

Custom Information Message for user based on another cell value

I am busy with an optimization spreadsheet which needs to display an information message, maybe similar to the Input Message for data validation (but I am open to suggestions). This message will be ...
IzakG's user avatar
  • 21
1 vote
0 answers
56 views

Clicking on an unlocked cell on a protected sheet is unprotecting the sheet

I have a workbook with multiple sheets. There are unlocked and locked cells. I have a macro to protect all sheets. After I run the macro and all sheets are protected, when I then click on a cell ...
Ana's user avatar
  • 11
2 votes
0 answers
45 views

Why does certain data imported from Word into Excel have yellow font, but not in Word?

Students fill out some tables in Word, and they must occasionally use a certain color font to get full credit. I'm using VBA to import their data and the color of their font from their submitted ...
Starnes Student's user avatar
0 votes
1 answer
9k views

Reoccurring Out of Office Every Other Week Outlook

In Outlook, is it possible to set a an out of office automatic reply every other week on the same day? e.g. every other Monday. I see a solution here using headers for every week: https://answers....
sushi's user avatar
  • 115
1 vote
1 answer
144 views

Excel VBA - Copy a formula result to a cell in another sheet + add succesive formula results in consecutive rows each time the formula is recalculated

I am running a partially randomize set of data and trying to find the best solutions depending on certain parameter changes. I need to "record" certain solutions and then compare different ...
Bao bab's user avatar
  • 11
0 votes
0 answers
898 views

How to import multiple csv-files in Excel at once with VBA

I am trying to import multiple csv-files within the same directory into my Excel sheet using VBA. The following code is working very well with just one csv-file. But I lack the knowledge to adapt my ...
Caroline's user avatar
1 vote
0 answers
51 views

Creating .txt files from excel columns with description [closed]

I am trying to create .txt files that have the following: Txt file name would be cell(A1) Content of the txt file needs to be the content of cell (B1) Repeat throughout the column I am new to VBA and ...
Abdullah Al Jaja's user avatar
0 votes
1 answer
1k views

Merge PowerPoint Presentations Slide By Slide as Animation

I have 12 PowerPoint presentations (one for each month) with same number of slides and each slide contains similar reporting info/trends/tables for the corresponding month. I would like to merge all ...
DigitalNomad's user avatar
  • 1,708
0 votes
0 answers
58 views

Disadvantages of checking for invalid values in a textbox

I am making a userform where I want to perform a regression analysis from the input data for four functions fi(x), which are recorded in each of the corresponding textboxes. To check if the input ...
Camila Sanchez's user avatar
1 vote
1 answer
667 views

Word 365 Allow Macros to run on Read-Only/Protected View

I am attempting to upgrade our company to Microsoft 365 x86 from Office 2019x86. We are currently stuck on 32bit because our electronically controlled document process currently has VBA macros that ...
Acurze's user avatar
  • 11
0 votes
2 answers
448 views

vba TRUE or FALSE text from Clipboard recognised as boolean by Excel

I have table with one of the column (let say column Code) has text TRUE in it. But, when I copy it to excel, the data become boolen so my vlookup (that search text TRUE from column code) become an ...
Loki Sinaw's user avatar
0 votes
2 answers
4k views

How do I stack multiple columns into one column in Excel 365 Mac

I currently have my data in different columns after using a Text To Columns feature. Now what I want to do is to put them all into one column. Can you please advise what formula to use or is there a ...
Sandee's user avatar
  • 1
0 votes
0 answers
2k views

VBA - paste multiple Excel ranges into Outlook as images

Trying to create an Outlook email that has Excel ranges pasted as jpg in the email, along with text before and after. Something like: Text Image 1 Image 2 More Text However, I cannot figure out how to ...
rebca912's user avatar
0 votes
1 answer
52 views

R studio, Excel, XLS files

I have 20 excel (.XLS) files. Each excel contains 13 Sheets. All of these excel are in proper format. I wanted to extract sheet no.10 from each excel and paste the data into an Excel sheet. I want ...
siri's user avatar
  • 3
0 votes
0 answers
815 views

Is there any way to open multiple hyperlinks at once in Excel?

I a have created list of email hyperlinks in my spreadsheet using only hyperlink formula (not VBA) with email content based on value of a few defined cells. =HYPERLINK("mailto:"&F16 &...
fleexio's user avatar
0 votes
0 answers
41 views

Open, copy and paste cells from multiple workbook to one workbook to one sheet

I have 15 excel files with two sheet. From each, cells A1:A48 should be copied from the first page to a new file in the sheet1, in order to the next column from the first cell. It only copies from 14 ...
Dragan's user avatar
  • 1
0 votes
0 answers
59 views

Multi Sheet Inventory that allows for an ordered quantity to be entered, once product delivered, the stock column updates to existing + ordered

I've been breaking my head over this one. I have an inventory that has 10 sheets and a 500 different items. Stock entry To enter data, you can select the manufacturer (Lieferant), the page on which ...
LukaV's user avatar
  • 1
0 votes
1 answer
412 views

Is there a way to have data copy and pasted from one table to another without having previous pasted data overwritten?

So I want to copy data from one table to another. the first table will contain values accumulated over one month.at the end of the month, all of those values will be copied and pasted to another table ...
Andre's user avatar
  • 1
0 votes
0 answers
128 views

VBA Code help to update date cell for each cell change

I am trying to automate a date of response column in excel from various user. I had updated the code basis some R&D from various blogs, but is stuck on one place. My code is given below. Same is ...
Deepak Aggarwal's user avatar
0 votes
1 answer
140 views

Solution to populate a ComboBox

Hello any suggestions for two small problems I have with the codes. I am working on a form that when entering the origin city (Enter city #1:) and the destination city (Enter City #2:), based on its ...
Camila Sanchez's user avatar
0 votes
1 answer
2k views

Excel VBA - Copy a Column without Header without Selecting

I am trying to clean up my VBA code to not .select anything anymore if I don't have to (nor use .Activate) because that seems to be the cardinal rule of efficient VBA coding. Here is my problem, I ...
Jordan's user avatar
  • 37
0 votes
2 answers
546 views

Transpose Group of Rows to Single Row | MS EXCEL

I need to Transform Some Uneven Group of multiple rows to single row I Tried to Extract the Required data from multiple row to multiple Column. But all data placed under different Rows (same as input ...
baskar's user avatar
  • 115
0 votes
2 answers
513 views

Excel VBA Macro to remove a specific duplicate character and leave one instance each time it finds it in a string

Windows 10 Microsoft Excel 2019 I have a Excel worksheet with multiple strings in each cell of Column A The strings are formatted like this: Some Text;;;;;;More text;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;...
Kenny's user avatar
  • 77
0 votes
1 answer
225 views

VBA - Way to loop through sheets and change print settings without activating sheets?

I sort of have two issues, but the one that I absolutely cannot find a straight answer to is can I loop through worksheets and apply Print SETTINGS to certain ones without activating them? It seems ...
Jordan's user avatar
  • 37
1 vote
1 answer
589 views

Sort values based on colors, then on values using VBA code

I'm tryin to sort values based on colors, then on values The macro was working very well, but on one sheet, so I have to create a new module for each sheet, and because I have around 400 sheets, This ...
Saher Naji's user avatar
0 votes
0 answers
53 views

Is there a way to stop previous day's values from being recalculated after new data comes through on the current day

My Excel formula depends on data I receive from a website every morning. My problem is, when new data comes, data from previous day recalculates & affects current day's value as it is also ...
Nobert Mazunze's user avatar
0 votes
1 answer
112 views

Word VBA Regex replacement text inserted to wrong place

I have a Word template with a macro that makes text replacements. But it pastes the replacement text to the wrong place. However, using the Word Search/Replace function manually (Ctrl + H; "Use ...
Johnnygirl's user avatar
1 vote
1 answer
1k views

Excel - CSV file formats Date column in different ways

I am working on creating a personal finance dashboard and therefore integrating different CSV files downloaded from different sources into one big table. The problem I am facing is that the date ...
totoro01's user avatar
1 vote
0 answers
86 views

VBA code to copy data from different works book to specific sheet of master workbook

I have to copy data from 15+ workbooks and combine it into a different master workbook. All these 15+ workbooks are identical and contains a sheet(tab) named 'Comment' and have same header names for ...
Avinash's user avatar
  • 11
-2 votes
1 answer
39 views

getting run time error when inserting a new columns by inputbox

getting run time error 1004 application defined or object defined error when i am run this vba Sub InsertColumns() Dim ColumnNumber As String Dim NumColumns As Long ' Get column letter ...
visshnu's user avatar
0 votes
0 answers
60 views

Microsoft365 VBE is oversized

I can not use VBA with my Office365. I'm using a high resolution laptop and an external monitor. There wasn't any problem before.. but for a few weeks my microsoft365 (office, excel, word, outlook, .. ...
HKILIC's user avatar
  • 1
0 votes
0 answers
25 views

Change from select to value assignment

I am having difficulty enhancing my code to remove the "SELECT" option and use the ASSIGNMENT. Meaning to change from the SELECT, COPY and PASTE to the assigning Values Directly. I am an ...
Mahadi Mu'azu L G's user avatar
1 vote
1 answer
536 views

Reset Conditional Drop-Down Lists

I hope you can guide me in a query. I am performing a search for several items in the worksheet Dashboard, with information that is recorded in Table1 located in the worksheet "Original data"...
Camila Sanchez's user avatar
1 vote
1 answer
593 views

Connect my ftp server, filezilla client works well, why ftp command line fails?

I'm trying to build up Excel VBA programmatically and expect it could download some files from the server via the FTP command line. The server which I set up at my home local network(experimental ...
Zhou Lei's user avatar

1 2 3
4
5
76