i am trying to create a VBA code to open a hyperlink in a cell, (This cells hyperlink changes depending on other variables in the spreadsheet, but i don't believe that matters)
Basically i want to press the macro, it will open the hyperlink, which could either be a document in excel or word, i then want it to print that document by an amount specified in a different cell in the same spreadsheet as the hyperlink.
I also want the document to not pop up, or at least close after printing has finished.
The printer it would need to print from is called SRV-papercut1
I have been attempting to code it myself, but cant quite manage, Any ideas?
Amount cell: J20 Hyperlink Cell: O18
I have attached a photo of the spreadsheet so you can see it.(I have cut off the company logo on the left for privacy reasons) One Button Print Spreadsheet
Related
I have made a Data Entry form in which i have recorded a macro Using "Use Relative Reference" from developers tab.
I have also added vlookup formula so that if a certain value or word is selected many of the fields being pulled or appears automatically.
I have created a button named as "Save Data" and have recorded a macro in it
After adding all the values (few values manually, few values I pull via Vlookup) whenever i press the button "Save Data" it moves the all values from data entry form to another Main Worksheet.
However the problem is whenever i press the button it also removes the formula of Vlookup and I have to either paste Vlookup formula again or add the values manually. the formula of Vlookup is
=VLOOKUP(C12,Functions!F$2:J$20,3,0)
Can anyone suggest if even after pressing the button and after moving the data the formula should remain there and i do not have to put them manually again and again
I have two workbooks. One is Microsoft Word, one is Microsoft Excel. The excel sheet is the model, and the word doc is the report (so formatting is important). I have values in excel that, when updated, I want to update also in the word doc while keeping the formatting.
I know that I can paste special, and I've tried both "merge formatting" and "keep source formatting". That only seems to affect the text itself, and not the layout of the text in the document.
Currently, this is what happens when I hit update link:
Before
After
I want to keep all the text where it is in the document, not have it relocated to new, separate lines every time the link is updated.
Thanks!
When I copy a text with an underlying hyperlink (example: displaying text = google, hyperlink = www.google.com) from a cell in excel and paste it into word or outlook, only the hyperlinked text has been copied (which is what I like!). When I paste it into some other application (like MS Teams) not only the text with the hyperlink is copied but also the format is adopted (a table with one cell with the hyperlinked text in it will be created). Now, I'd like to get rid of the cell/table Information and only paste the hyperlinked text like it is done in word. Is there a way in VBA to achive this? I thought that this format information must be stored somewhere in the clipboard but I couldn't find and delete it.
Any Ideas?
Thanks,
Sebastian
Complete beginner with VBA and I think I'm doing something majorly wrong.
So context;
Creating a user friendly sheet to do checks on items etc. To keep it as simple as possible for other people I've decided to use drop down menus to input the majority of the data and tick boxes to say when the check has been done.
From here I want to add a big old button that will transfer the data from the cells, dropdown menu and tick boxes to another sheet or workbook.
I would also need the sheet or workbook to place the date the checks were done and create a new line with the information. So that I can look at a single sheet and see the wear and tear on the equipment in one form. (layout of this can be sorted out after wards just how to get it to go to a blank line etc.)
And finally to save the document.
drop down information is linked from another sheet within the workbook.
Now I've tried some code to work it out myself and it either doesn't copy the data as the cell is blank (drop down menus) or it just shoots up an error on the VBA page.
Could anyone assist in helping me work this code out? Even if its just the command syntax's that I would need to use.
Thanks in advance
Peter
I have notice that if you insert a hyperlink into any cell in Excel and set the text to display to be a number (1, for example), it causes the entire cell to now be clickable in addition to preventing you from changing the hyperlink text afterwards. If you try to change the hyperlink text by going to Edit Hyperlink the Text to Display is always Selection in Document.
If you do the exact same thing but make the Text to Display an alpha character (like a), it works just fine and you can edit the hyperlink Text to Display without issue.
This is causing problems because I am trying to read Excel data using Interop libraries and even those libraries are unable to read the Text to Display when it is set as a whole number with no decimal places.
If you create a Hyperlink like:
You can later edit the "Friendly Name" by selecting the cell and doing the edit in the Formula Bar.