Hi, good morning, i have the code below but i was wondering if there was anything that could be done to make it abit more compact? also is there anyway to stop the pop up of the file?
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim lookuprng As Range
Set wb1 =...
Hi there,
For clarification what I am looking to do is to try and save the macro to the work book so others who use it don't have to import the macro.
I managed to add an auto lookup macro to the ThisWorkBook in VBA but that applies the macro when you open the workbook.
I want a button or...
I have a new PC (Windows 10 Pro 64 bit) with a fresh install of Office 2016 32 bit. In VBA editor, clicking (left or right) on ThisWorkbook causes Excel to crash and either close or restart (different behavior at different times). This occurs in a new, blank Excel file and in files with...
Hello everybody.
I need my macro "Test" running every day at 11:30.
Writing in ThisWorkbook
Private Sub Workbook_Open()
Application.OnTime TimeValue("11:30"), "Test"
End Sub
is not a good idea: it does not work, probably because of a loop.
So, I've tried to identify univocally date and...
I am having issues with setting workbook variables. After numerous searches and reading posts, I don't ever find a satisfactory answer as to why my code doesn't seem to work. I have had this issue with a few different projects. Here is my most recent issue.
I am attempting to remove some...
Hello all,
When I open my workbook, my opening code doesn't run and I get an error stating: "Compile error in hidden module: ThisWorkbook..."
Any ideas what could be causing this?
I created a personal macro that would allow me to automatically send emails using Excel. The macro works fine if I am using the actual workbook where the macro was created but not on new workbooks. I believe the macro is generating the fields to search base on the work book where the macro was...
Hello All,
I need to copy data from one workbook to another. The catch is the source workbook has a name that will always change. The second is a static workbook.
I have a macro that uses msgboxes to prompt the user for the correct template file accomplish this goal quite well however it is...
I have a very simple Excel workbook that must be sent via email to hundreds of people. A requirement is this workbook must open to the "Home" sheet every time the user opens it. So, I used the ThisWorkbook Open method to accomplish this. It works fine locally, but when users download and open...
Hello everyone, this is my first post!
I am trying to make some code to copy a module from my add-in, to the active workbook's ThisWorkbook module. I can't seem to figure out how to access it though. Here's the code I'm using:
<code style="margin: 0px; padding: 0px; font-style: inherit...
Hello,
The help I've found on this subject has been great, but now I think my problem is more specific. I have the following code applied to one worksheet (right click sheet tab and click "view code") and it works very well:
Private Sub Worksheet_Change(ByVal Target As Range)
If...
Any particular reason why my vlookup code isnt working? I am using 2 workbooks & want to set the open workbook as "PriorBDay" & use that Name as the VlOokup source.
Please help
Dim dtTestDate As Date
Dim sStartWB As String
Const sPath As String =...
I have a very strange problem with Excel.
In Excel VBA I use ThisWorkBook to run some initial commands at start up for example:
Private Sub Workbook_Open()
With Application
.ScreenUpdating = False
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ScreenUpdating =...
Hey all, I've inherited a macro that I'm trying to modify to capture additional info. Currently, the macro extracts data from all spreadsheets in a folder (that meet certain conditions). However, when I add in the commands to grab the filename, it causes the macro to only successfully loop...
I'm working with a client who has had version-control issues with their financial models. I created a button so that the workbook saves with a version number and date into a specified folder. I'd like for this to be the only way to save the workbook. I used the code in the ThisWorkbook...
Hi all,
I wonder why my VBAProject Explorer shows some worksheet that does not exist in my workbook... :confused: What when wrong? I'm sure no sheet is hidden..... I see Sheet1 (Sheet1) thru Sheet5 (Sheet5) on this explorer and I can't find these spreadsheets in my workbook...
Also I have one...
Hi all knowledgeable excel people out there!
The code below will open my spreadsheet at any specified fixed location (e.g. A1) , but is it possible to re-write this code in such a way that the spreadsheet will open at a dynamic location instead?
Private Sub Workbook_Open()...
Dear all,
I have a large VBA programme which was working very wel in the MSOffice 2003 version.
Now we have installed MSOffice 2010, the VBA is halting after some time.
We found out that in the Excel sheet, which is being approached by the VBA, a bar is shown in the upper part of the sheet...
First time post....
Struggling with an Excel VBA problem as follows:
Background:
Windows Server 2003 used for a scientific application.
No Internet access - just a closed private network
Microsoft Office ExcelVersion 11.
Build 6560
Application pathC:\Program Files\Microsoft Office\OFFICE11\...
Hello, and I'd like to say thank you in advance for helping, if you can. Ok, so the code that I have placed in "ThisWorkbook" of "Microsoft Excel Objects" in the visual basic editor. Here is the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.