Extract data from Excel based on value in cell

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: Extract data from Excel based on value in cell

Post by RNIB » Wed Sep 24, 2014 1:42 pm

JRL wrote:
Until>k=8 (the number that is in cell C1 in my spreadsheet)

Then it does stop looping when K=8. So that would suggest that either headings_no is not being stored or that it's value isn't 8. Yet if I add this just before Until:
If you're pulling the value out of a spreadsheet it may have a tab or a CRLF attached at the end. You might need to strip extra characters off of the number. Use whichever of these that is appropriate immediately after variable "headings_no" is assigned its cell value.

Code: Select all

StringReplace>headings_no,tab,,headings_no
StringReplace>headings_no,cr,,headings_no
StringReplace>headings_no,lf,,headings_no
Ooh hang on, just used all three together and it worked :shock: :mrgreen: :shock: :mrgreen:

Wow! THANK YOU!! I seriously doubt I'd ever of worked that out by myself.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Extract data from Excel based on value in cell

Post by JRL » Wed Sep 24, 2014 1:52 pm

Excellent! I've been struggling to get DDERequest> to work at all. I've rarely used it and not at all for perhaps 10 years. I always use DBQuery> on my excel files.

When I try DDERequest> I get: "DDE_SERVICE_INVALID" as my result.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts