Posts

Showing posts with the label excel

Downloading excel data using Axios from Laravel backend is not working

Image
Clash Royale CLAN TAG #URR8PPP Downloading excel data using Axios from Laravel backend is not working I am developing a Web application using React JS for the front-end and Laravel for the back-end API. Now, what I am trying to do is I am trying to fetch the excel data from the backend using axios and then download the file. This is my laravel API controller action method. function downloadExcel(Request $request) { //other code goes here return Excel::create($left_photo->id . "-" . $right_photo->id, function($excel) use ($excel_data) { // Set the spreadsheet title, creator, and description $excel->setTitle('Mapping points'); $excel->setCreator('Laravel')->setCompany('Memento'); $excel->setDescription('Mapping points file'); // Build the spreadsheet, passing in the payments array $excel->sheet('sheet1', function($sheet) use ($exce...

Connection Word --> Excel with VBA

Image
Clash Royale CLAN TAG #URR8PPP Connection Word --> Excel with VBA I'm currently working on a project within my company to create a link between Word and Excel. There are different cells in excel which should be visible in word. These cells need to be updated in Word whenever they change in Excel. I know, this isn't much of a problem because MS office does support this by creating a link between those two files. This works fine but the problem is all the documents are stored in a CRM system called Efficy. A person who works for efficy created a tool so the two documents which need to be linked are opened simultaneously in a folder. The folder is called for example "Test folder - 21001". The name of the folder changes per project in the CRM system. So if i open another project it will be called "Test folder - 21002" for example. Is it possible to create a link between Word and Excel which is always the current folder of the Word document? The excel file alw...

Can't copy sheets from one file to another

Image
Clash Royale CLAN TAG #URR8PPP Can't copy sheets from one file to another I'm new here, and was hoping to get some help with my code. So i got 2 Excel files. test1 and test2. Im trying to take 5 rows and 5 columns from one to the other. But it gives me a weird error.. Heres the code: 'rows For r As Integer = 1 To 5 'columns For c As Integer = 1 To 5 'copy the value of the cell WB2.Sheets(2).Cells(r, c).Value = WB1.Sheets(1).Cells(r, c).Value 'or text: 'WB2.Sheets(2).Cells(r, c).Text = WB1.Sheets(1).Cells(r, c).Text Next Next the loop gives me an error "HRESULT: 0x8002000B (DISP_E_BADINDEX)) Where exactly do you get this error? maybe a screenshot of what you're trying to do would help. I get the impression this is not a VBA error and that your question is missing some critical infomation. – ashleeda...

Copy a selection and insert it to the bottom(n times) Excel

Image
Clash Royale CLAN TAG #URR8PPP Copy a selection and insert it to the bottom(n times) Excel Suppose I have a template a,a,a,a,a,a,a b,b,b,b,b,b,b c,c,c,c,c,c,c I want to repeat this block n times. let's say I want to repeat 3 times so n = 3. a,a,a,a,a,a,a b,b,b,b,b,b,b c,c,c,c,c,c,c a,a,a,a,a,a,a b,b,b,b,b,b,b c,c,c,c,c,c,c a,a,a,a,a,a,a b,b,b,b,b,b,b c,c,c,c,c,c,c OK, let's say that. Where are you stuck? – Roland 33 mins ago Look into For Loops – QHarr 31 mins ago Have you tried using record macro? – Solar Mike 25 mins ago ...

Excel - Search entire worksheet for a cell contain a string of text (formula)

Image
Clash Royale CLAN TAG #URR8PPP Excel - Search entire worksheet for a cell contain a string of text (formula) Hopefully this is a fairly easy one. I have an Excel file which has a Summary tab at the start, followed by several tabs which contain weekly information. As the weeks progress, I may add additional rows to the weekly sheet, meaning that the total is not always in the same cell on each sheet. I am looking for a formula that will search a specified weekly sheet for the words "Grand Total" and return it's address, which I can then build into other formulas, so that the Summary sheet will populate the correct values regardless of whether additional rows have been added. 2 Answers 2 Hi, your question should always contain your current efforts and ideally some code as well. But given it's a fairly basic question to answer and you're new here I decided to answer it With that a...

How can I URL encode a string in Excel VBA?

Image
Clash Royale CLAN TAG #URR8PPP How can I URL encode a string in Excel VBA? Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality? 14 Answers 14 No, nothing built-in ( until Excel 2013 - see this answer ). There are three versions of URLEncode() in this answer. URLEncode() A variant that supports UTF-8 encoding and is based on ADODB.Stream (include a reference to a recent version of the "Microsoft ActiveX Data Objects" library in your project): ADODB.Stream Public Function URLEncode( _ StringVal As String, _ Optional SpaceAsPlus As Boolean = False _ ) As String Dim bytes() As Byte, b As Byte, i As Integer, space As String If SpaceAsPlus Then space = "+" Else space = "%20" If Len(StringVal) > 0 Then With New ADODB.Stream .Mode = adModeReadWrite .Type = adTypeText .Charset = "UTF...

VBA: Excel 2013 autosave user desktop File Format Error

Image
Clash Royale CLAN TAG #URR8PPP VBA: Excel 2013 autosave user desktop File Format Error I have a product creation template, which filled by other users. I'd like to automatically save it to users desktop. I have to problems. First one is I'd like to save file to users desktop with predefined name. I wrote a similiar code at my last job (excel 2010) in my new job we are using excel 2013 and file paths are different. So I have to extract users desktop path, they can use pc with other languages so I'm not sure whether below code will work. CreateObject("WScript.Shell").specialfolders("Desktop") Second problem is I want to save it as "xlsm" and when I changed the file extension to ".xlsm" it didn't save. My old code which I used my last job is; ActiveWorkbook.SaveAs Environ$("UserProfile") & "My Documents" & Environ$("UserName") & " - " & Format(Date, "yyyy-mmm-dd") ...

Linear aproximation in excel between ages

Image
Clash Royale CLAN TAG #URR8PPP Linear aproximation in excel between ages so I have a problem with linear aproximation in excel, see the data below... Age X1 Population 20-24 11 1243 25-29 13 3411 30-34 15 3973 What I need to do is that I have data like these and I want to calculate X1 not for "Age" between ages as you can see but to calculate it for every single age, so not 20-24 but 20,21,22,23,24...For that I have population info, so I know that for 20 there is 200 population, 21 231 population and so no... Really apreaciate your help! How are you doing this now, without excel? – Ron Rosenfeld Jun 28 at 19:04 I may be stupid but how do we know that 20 = 200, 21 = 231, etc? – Scott Craner Jun 28 at 19:12 ...

Overcome #REF error using INDEX MATCH FUNCTION

Image
Clash Royale CLAN TAG #URR8PPP Overcome #REF error using INDEX MATCH FUNCTION I am getting reference error which I am not understanding the logic behind. Anyone please help me with this. Thanks in Advance!! SHEET 1: SKU Reference Type PP_1 PP_2 A A X 61.99 17.9975 A A-A Y 56.99 A A-S Y 56.99 B B X 68.99 19.7475 B B-A Y 68.99 SHEET 2: SKU Reference Type PP_3 A A X 17.9975 A A-A Y #REF A A-S Y #REF B B X 19.7475 B B-A Y #REF OUTPUT_REQUIRED: SKU Reference Type PP_3 A A X 17.9975 A A-A Y 56.99 A A-S Y 56.99 B B X 19.7475 B B-A Y 68.99 FORMULA I TRIED: =INDEX(Sheet1!D:E,MATCH(A5,Sheet1!A:A,0),MATCH(C5,{"X"," ","Y"},0)+AND(VLOOKUP(A5,Sheet1!A:C...

Create a simple counter

Image
Clash Royale CLAN TAG #URR8PPP Create a simple counter This is simple on the surface but I cannot figure out how to pull it off. This is why I am coming to you guys. I want to create a button in excel, that will count numerically in a single cell the number of times the button is pushed. That is it. Any ideas on how I can pull this off? Anything you have tried so far? WE are eager to help with problems, not solve them completely for you. – Beri 46 secs ago By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Find & Replace functionality automatically formats cells to dates

Image
Clash Royale CLAN TAG #URR8PPP Find & Replace functionality automatically formats cells to dates Oftentimes when converting PDFs to excel documents, some values are distorted and inaccurate. Precisely, some cells within my "Date" Column do not contain the correct month, grammatically. For example, instead of " XX Jun ", it is " XX Iun ", where "XX" represents a day (number). XX Jun XX Iun I've resorted to use the Find & Replace functionality and it almost works perfectly, with the only caveat being that, after replacing, my cells are formatted to dates when I want them to remain as texts. What I'd therefore like resolved, if possible, is to use the Find & Replace functionality without it formatting my cells to dates after replacing, by modifying my VBA code. Sub Macro2() Dim rng As Range Set rng = Application.InputBox("Select Date Column", "Obtain Range", Type:=8) rng.Replace What:="ian", Replace...

Error when accessing an Excel workbook from within a parallel loop

Image
Clash Royale CLAN TAG #URR8PPP Error when accessing an Excel workbook from within a parallel loop I am using MATLAB to write to an Excel file with Macros in them, and then reevaluate the file and extract the Macro results using xlsread . The code works fine with only one worker. However, if I use parfor and use a second worker, MATLAB gives the error message as below. To be rigorous, I have created a second Excel file for the second worker and use t = getCurrentTask(); t.ID; to instruct the workers to work on their arranged excel file. xlsread parfor t = getCurrentTask(); t.ID; Error using xlswrite (line 226) Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: Microsoft Excel cannot access the file 'C:Users-----D0481000'. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook. Help File: xlmai...

Excel: Check to see if Two Values are Between Two Other Values

Image
Clash Royale CLAN TAG #URR8PPP Excel: Check to see if Two Values are Between Two Other Values I am having a nightmare of a time trying to find a solution to this problem, and am hoping you wizards can help. In the example below, I have a dataset (columns A through C), and reference columns (F to H). Column D is the desired output for the formula. This column has been populated with an example of the output I want. Table 1. Table 1 shows my dataset. My goal is to generate (using a formula) an output in column D that classifies whether data in rows 2-14 in columns B & C fall within the start and end parameters of my reference dataset in columns G & H . If true, the formula should return the line number as shown in column F where the match exists in column D . column D rows 2-14 columns B & C columns G & H column F column D Using IF(AND( formulas, I was able to figure out how to do this so long as the start and end of B & C were >= to G , and <= to H . Examp...