Good afternoon friends, is there any way to write a value in a specific cell on each sheet of the excel workbook using "Foreach" or in some other way?
Example: Write the number 3 in cell A3 of each sheet of the current workbook
I am trying to open the most recent file in a specific folder but when I run the program an error appears and says that the folder does not exist (but it does exist), can someone help me?
Code:
Private Sub WriteValues()
Workbooks.Open (myMostRecentFile)...
Hello guys, i have a problem in my procedure, everything that happens before trying to execute the procedure is read by the program,
but when we call the procedure it doesn't just work in the specific form, can someone help me?
This codes works:
Private Sub bt_calculate_Click()...
The "error":
The code:
Dim oPL As Double, o709 As Double, o710 As Double, o713 As Double
Application.ScreenUpdating = False
Sheets("Calculation_Sheet").Visible = True
ActiveWorkbook.Sheets("calculation_sheet").Activate
Note: P666, P709, P710 and P713 are global variables...
Private Sub UserForm_Initialize()
Call CallTime_Msg
lb_hello.Caption = msg
lb_tec.Caption = Tec
End Sub
Sub CallTime_Msg()
Dim mHour As Integer
Dim msg As String
mHour = hour(Now)
If mHour < 12 Then
msg = "Good Morning"
ElseIf mHour < 18 Then
msg = "Good Afternoon"
Else
msg =...
I'm trying to select a textbox from my form in excel with the command #set focus "but apparently it gives me an error, can someone help me?
Error:
Private Sub cmd_Recheck1_Click()
A0r = in_A0r.Value
A90r = in_A90r.Value
A_90r = in_A_90r.Value
A1 = 0
A2 = A90r - A0r...
Since I added the time format the code stopped working, is there any way to include the time in the file name?
Code:
Sub SaveAsPDF()
Dim FilePath As String
Select Case MachineName
Case "A4", "A8.1", "A8.2", "A8.3", "A12.1", "A12.2", "A12.3", "A20.1", "A20.2"
FilePath...
Hello! EDIT: Wrong title, sorry
For this problem of mine, I know what I need to do, but I'm not really sure where and how to implement it properly. So:
If the checkbox is selected, and the first combobox is selected, the options for the first combobox will be allowed to be selected. Then, if...
I have come to the conclusion there appears to be two distinct styles of programming in VBA.
1. Those with no prior experience of programming.
2. Others who are already conversant with Java, C#, etc.
I have seen VBA code such as:
Function MyFunc (somearg As Burger) As McDonalds
and then...
Hi. I read through Chip Pearson's Programming the VBA Editor and his examples are working for me. What I want to do is programmatically control the font in the VBE code modules without using the Font Dialog because that dialog does not exist on the Mac. After checking the Object browser, it...
Hello all,
I recently discovered the benefits to converting Excel documents to XLSB (binary), mostly the cutting almost in half of file sizes.
I would like to apply this to some of my older files, but don't want to sit around resaving these documents.
That macro should be able to search...
Hi everyone!
My file size is upto 29MB, although no data is entered yet. How can I reduce its size as there is no excessive programming or pictures in it.
Hello, I would like to change the colour of the cells based on a rule permanently. I used conditional formating for top 2 values in each of my columns. It was supposed to change the colour of top 2 cells in red and it did it, but after that I needed to copy and paste only the colour of the cells...
Hello Mr. Excel forum!
In the past month and a half I have designed a macro at work, that after much sweat and many tears, finally does what I intended it to do. It was the second time that I made a macro with the last time many years ago. Since I had to google a lot to figure out how to write...
Hello everyone,
Just a quick question, if I have knowledge of VBA in Excel could i be certain to say that i know Visual Basic ...not for applications. Are they literally both the same programming language?
Don't know if this makes sense lol
Hi
I have a simple question, why in the following line the variable is not assigned the value directly like this:
source_date = b8 instead of the following:
source_date = Range("b8").Value
Thanks for your help.
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.