Please mention the cell value properly.
Try to print the cell value excelRange.Substring(0,1)+Index in a message box and check if you can get the correct output.
An Object Reference error normally means the variable you’re referring to is empty or not initialised. Put a breakpoint in your code, run your code in debug and check the Locals panel see which variable is empty. I imagine it’ll be either your cell value as you haven’t included it in your screenshot, or your LookUp Range activity as you’ve not specified a range to lookup against.
Hi Anil, I am trying to look up based on my variable called input excel, which gives me Apr’ 23. Based on this month and year I extracted, I want to lookup the specific then write the distance that I have also extracted into the month I found
Intended outcome
Could it be a difference in the position of ’ in the months?
if so in excel Apr’23 might have a different value as well like fulldate…check by opening excel manually or by reading the excel data into a datatable…
If you would require to write on that particular column, you would need the Excel Column Letter Z and not the Column Header name as you are directly writing in Excel cell.
So the Range that you would need to get is Z.
Could you let us know how are you getting the Column Name Apr'23, we can modify that to get the required Excel Column Letter.
Let us know if the above is understandable and if it is the step required.
I get actually get the month from text/left right on some invoices.
In this format
However, in the excel I was provided, the month of column z is in this format after writing line 04/30/2021 00:00:00. At the point of my post I only tried to change the format to what I saw in the excel which was Apr’ 23.
I’m not sure if this information is helpful to you