+ Reply to Thread
Results 1 to 4 of 4

String not Recognized as String

  1. #1
    Registered User
    Join Date
    09-10-2018
    Location
    Flint, MI
    MS-Off Ver
    2016
    Posts
    2

    Unhappy String not Recognized as String

    I am writing a macro that is essentially taking information from one column in Workbook A and copying and pasting it in another column in Workbook B. All of that works just fine- I'm running into issues with how I've declared my workbooks.

    "Book Name" is the name of Workbook B and "FileName" is the name of Workbook A. For example: If Workbook B is "Sample1" then Workbook A is "Sample1 (proc)". My issue is that Filename is seeing "BookName" as me wanting to write book name instead of seeing its actual value. That is, instead of getting "Sample1 (proc)", I'm getting "BookName (proc)".

    Help would be much appreciated! This code was working this morning exactly as it's written below, but I guess the stars have realigned and it's no longer working

    Please Login or Register  to view this content.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: String not Recognized as String

    Hmm? Code should not have worked as it is...

    Few issues here...
    1. You are storing string variable in BookName. Yet, you are not using it as a variable, but string literal (i.e. "BookName").
    2. To open a workbook you should have file extension as well (.xlsx, .xlsm etc).


    So assuming cell R12 has workbook name without file extension... and R11 has folder path without closing "\"...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    09-10-2018
    Location
    Flint, MI
    MS-Off Ver
    2016
    Posts
    2

    Re: String not Recognized as String

    Thank you! This works like a charm! All this coding logic and how excel is reading things is all still quite new to me, much appreciated!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: String not Recognized as String

    You are welcome

    If your question is resolved, please mark the thread as solved by using Thread tool found at top of your initial post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] extract multi-letter string bits from string depending on size and case
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-18-2017, 10:41 PM
  2. [SOLVED] Macro to change 1) part of string, 2) the order of characters inside a string, 3) format
    By Karl Gustaf Karsten in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2015, 11:51 AM
  3. Replies: 1
    Last Post: 08-07-2015, 04:01 PM
  4. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  5. [SOLVED] VBA for searching string in a column and copy rows depending on string in adjacent cell
    By xprakash in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2013, 05:58 AM
  6. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  7. [SOLVED] Translate form data into a text string and output that string into a preformated length
    By TJ Saulnier in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-19-2012, 03:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1