Can someone please tell me why this works:
Sheet1.Shapes("Button").Select
With Selection
.ShapeRange.Fill.ForeColor.RGB = 12345
End With
but this doesn't:
With Sheet1.Shapes("Button")
.ShapeRange.Fill.ForeColor.RGB = 12345...
This is not a typical question thread, although I hope it may be of interest to those who play around with Excel for fun. It's somewhat in line with the "Tough Problem" series that ran a few years ago in this forum. People with spare time and interest might read on.
With the advent of the new...
Hi
I am trying to merge 2 different files. The first file is hello1.xlsm (workbook1) in which i wrote the vba code below. hello1.xlsm is saved in the same folder of the second file which I want to merge it with, the second file called abc.xlsx. I got run time error - "method "mergeworkbook' of...
I am teaching myself VBA and I have been running a certain task via Copy and PasteSpecial Paste:=xlPasteValues and it completes the macro within 7 seconds. The task is to move the values to the left by one column.
I've recently read the clipboard should be avoided when possible thus I used an...
Was designing a Form and everything working fine when all of a sudden everything you click on "dings" at you.
I have to Control-Beak and the code is hung on the Line MyForm.Show.
Pressing F8 re-runs the same subroutine and/or (at times) has brought up
Run-time error '400':
Form already...
Hello guys,
As I said in the title, I have a spreadsheet with a million unneeded rows and I cannot delete them with the select rows, delete rows, save spreadsheet method.
What other methods are there?
Assume Sheet1 is active.
In a module, I type:
Sub Test
Sheet2.Cells(1,1).Select
End Sub
This returns a Run-time error '1004:' Select method of Range class failed.
I assume the reason is you must be on the active sheet to select a cell in it.
However, this works if you are...
I am receiving a "method range of object global failed" error on the line below
.Top = Range(Cells(((aa - 4) * 5), 1))
Set chrt = sh.ChartObjects.Add
With chrt
.Top = Range(Cells(((aa - 4) * 5), 1))
aa is a for variable. My goal is to stack charts below one another 5 cells apart. The...
My current code simply adds a 1 to the module's names, just wondering if there's a replace command I could use or some other method, Thanks
Sub Import_basFiles()
Dim StrFile As String
StrFile = Dir("C:\users\steve\desktop\basfiles\")
Do While Len(StrFile) > 0...
Hi all,
Let's say we have an embeeded and linked document in a worksheet - Does anybody know of a VBA method for retrieving the link source name ?
I am referring to the actual document full path name that is displayed on the oleobject icon or in the formula bar when the oleobject is selected...
Hi,
I have a code as below:
ActiveSheet.Shapes.Range(Array("image1.jpeg")).Select
Selection.Delete
Windows("Formatting Tool.xlsm").Activate
Sheet1.Shapes("image1.jpeg").Copy
Windows("Format File.xlsx").Activate
Range("H8:H8").Select
ActiveSheet.PasteSpecial...
Can anyone offer any advice as to why the following code randomly generates a run time error 1004, 'Method 'SaveAs' of object '_Workbook' failed'?
I've read various bits on the internet, none of which seem to apply here, (for example the workbook is not on a shared or mapped drive).
If there...
I have this code below, but not sure as why it is giving an error
If ws.Range("C" & lastrow).Offset(0, 24).Value <> "" Then
ws.Range("C" & lastrow).Offset(0, 24).Select
ActiveCell.Insert (xlShiftToRight) --- (insert method of range class failed)
ws.Range("C" & lastrow).Offset(0...
Can someone tell me why I get the error: "Select Method of Range Class Failed"
Sub MICROPHARAOHVIEW()
Application.ActiveWorkbook.Sheets("MICROPHARAOH").Cells(1, 26).Select
End Sub
Good morning,
I now need to save the project I created in Excel 2010 as Excel 97-2003 so that my boss can try it out. Can anyone point me to a method or tool for checking compatibility of my current macros with Excel 2000?
thanks much,
Bill
Hi - I converted few excel files from .xlsm to .exe with the help of online converter tool.
I'm facing issue to close those files in workbooks.close method.
have tried the below,
workbooks("E:\Macroconnect\Amb2013.exe").close with no success.
please help me on this.
Hi, I need a macro genius's help please!
I am trying to put together an attendance register for a club I run and we use 5 different types of payment method (just to be difficult). I want to have 5 command buttons that relate to the 5 methods that when pressed for each student one by one will...
Okay, so correct me if I'm wrong, but the purpose of the Worksheet_Change function is to run your code and update each time something is changed in the actual Excel sheet, right?
I am having trouble using the Worksheet_Change method in my VBA program. Photos here of my code and then of my...
"Hi
I want to delete all rows in my table if Column I is 99. The below code give in and runtime error 1004 AutoFilter method of Range class failured
The 99 is a number not text, so I also tried 99 instead of "99" but got the same error. Could it be because it is a table ? If so how can I fix...
Hi Guys,
Can anyone tell me how i can adapt this code.
Basically I use an input box and need a value of 0 or 1. If a different value is entered I want to goto the beginning so they have to enter 1 or 0.
I am not sure how to write this code
If x <> 0 Or <> 1 Then
To test if the value is...
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.