Hiya Mike,
according to the Microsoft docs site here, you need to use something like:
ActiveDocument.Shapes(1).TextFrame.TextRange.Text = "My Text"
So, depending what the shape index is (or name) in your document, your code should look more like:
filename = Shapes(1).TextFrame.TextRange.Text...
A clever way to detect the insertion of cells (with a test for if this insert is a whole row) is included in post #4 at this link.
It covers inserting from the command bar, and from the right click menu.
You could disable calculation and enter your "SET_UP" string in the appropriate location...
Hi Malleshg24
your query appears to have fallen through he cracks somewhere so I took a few minutes to look at it today.
I have modified your first macro to perform both tasks in either order exactly once on a dynamically sized data-set.
It is unclear from your query if you want it to work this...
Hi Sam,
the below seems to work specifically only for the extension you specified, but when doing an input such as 'test.xlsx' it causes an error.
I suspect this is something to do with compatibility with vp project code, but i'm not sure. - I fixed the recursion issue quite simply, I was...
Hi Sam,
I have not solved your problem, but I spent some time thinking about it and my work may help you get closer to a solution.
The problem as I see it is that if you use BeforeSave (as per your example), you cannot capture the new filename or extension and therefore cannot run your check...
Hi AV114
I'm not sure how you would 'click' the button, but perhaps just running the script which the button runs would work?
Something like:
IE.document.all.Item
Call IE.document.parentWindow.execScript("fnXlExport('myTable', 'myExcel')", "JavaScript")
Where IE is the webpage object.
I found...
Hi Inddon,
I am not sure that you can be that specific around the opening of workbooks. If you can, then I am not sure how it would be done only for workbooks opening in a different instance as you mentioned in your second comment.
Stevie
Hi inddon
you should be able to capture another workbook being opened with WindowDeactivate and prevent it there if it has the wrong name perhaps.
In Thisworkbook:
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Dim SecondWB As String
SecondWB = "Workbook2.xlsm"
If...
Based on the above conversation, it appears that my original method may be your only option.
As you have a working solution from my first reply and can set the IE window to be not visible should you need to, I would suggest running with that.
As Chihiro said, it's a simple change:
IE.Visible =...
Hi stefan,
I had a look around, finding that the below helped one user with the same problem:
try replacing the line:
Set XMLHTTP = CreateObject("MSXML2.serverXMLHTTP")
with the line:
Set XMLHTTP = CreateObject("MSXML2.serverXMLHTTP.6.0")
Stevie ^.^
Hi akika,
I assume you mean something like this:
Sub a()
Dim numusers As Double
Dim permoption As String
numusers = Sheets("Sheet2").Range("A1").End(xlDown).Row
permoption = Application.WorksheetFunction.VLookup(Application.UserName, Sheets("Sheet2").Range("A2:B" & numusers), 2...
Hi inddon,
I had a go and managed to get a defined tracking number to output as you requested.
I fell into an error when attempting to deal with the 'Sign up for our Newsletter' pop-up. This may not be an issue for you if you system is signed up already?
Regardless, this worked for me and should...
Hi Sriram,
Hui's code will produce the results you are looking for, but it may be worth considering the requirements at a higher level. What will you be using these pairings for?
I ask this as 9148 C 2 = 41838378 (9148 P 2 = 83767756 if order matters! - it seems to in your example), which is a...
Hi j4k3,
when I personally am trying to debug things like this, I try to go back to the simplest form and check that that is working as intended.
I would suggest manually loading some variant objects with known y and x values and doing a quick test in the form below:
Dim instance As...
Hi Frisbeenut,
try this:
Sub frisbeenut()
Dim checkStr As String
Dim cell As Range
Application.ScreenUpdating = False
checkStr = " (est.)"
For Each cell In Selection
If Len(cell.Text) > 0 Then
If Right(cell.Text, 7) = checkStr Then
cell =...
Hi frisbeenut,
try this:
Sub frisbeenut()
Dim checkStr As String
Dim cell As Range
Application.ScreenUpdating = False
checkStr = "(est.)"
For Each cell In Selection
If Len(cell.Text) > 0 Then
If Right(cell.Text, 6) = checkStr Then
cell =...
Hi ham123,
I would first point out that this is the VBA section of the forum and so if you are trying to avoid using VBA, then this is perhaps the wrong place to ask the questions.
That being said, each one of your items above are relatively discrete problems each with solutions which can be...
Hi Thomas,
please try the below:
Sub Thomas()
Dim mnths As Variant, mnth As Variant, length As Double, copyrange As Range
length = Sheets("Summary").Cells(Sheets("Summary").Rows.Count, 2).End(xlUp).Row
Set copyrange = Sheets("Summary").Range("B4:B" & length)
mnths = Array("Jan"...
Hi dwrowe001
I have not looked at your files, but this code does what you described:
Sub dwrowe001()
Dim searchNum As Double
Dim offsetNum As Double
Dim outputString As String
Dim searchRange As Range
Dim c As Range
searchNum = Sheets("Sheet1").Range("A1").Value 'set this...
Continued:
Further than this I cannot tell from the code, and should my explanation be insufficient, I would suggest that perhaps this code is too advanced for you and you would benefit from doing some learning on VBA and programming in general. Each of the functions and attributes which you...
Hi Anbuselvam,
If Target.Count > 3 Then Exit Sub
This prevents the code from running if the user's selection is more than 3 cells.
K = 7
In the code you pasted above, it is k=8, but either way, k is a variable used to store the row where data is inserted later on in the code: lines 23-26
In...
I also do not have Lotus Notes and cannot test, but when I have used Excel with Lotus Notes in the past, I successfully used this:
https://www.rondebruin.nl/win/s1/notes/notes.htm
as reference.
I hope it helps you.
Stevie
Hi Rahul,
you have not posted the most relevant part of your code which cycles through the bookmarks and relates them to the range you are copying.
That said, from what you have posted, i'm struggling to see why you can't just skip the bookmark you have no data for:
If Sheet.Sheets("Weekly...
Hi Maxwolf,
the below code should open all workbooks in a folder you specify, 1 by 1 and delete the contents of the first 4 rows before saving and closing that workbook.
If instead you want to delete the rows entirely, replace 'clearcontents' with 'delete'.
Please be very sure that you know...