+ Reply to Thread
Results 1 to 4 of 4

VBA macro cutting off information

  1. #1
    Registered User
    Join Date
    01-05-2021
    Location
    Scottsdale, AZ
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    VBA macro cutting off information

    Good afternoon, I'm an RPA Analyst currently building a bot that automates a process for my AR team. In my automation, there are steps that execute macros and for the most part, they don't give me any trouble. But recently I've noticed that one of the simple ones is cutting off information that's vital to the completion of the process.

    It starts when I have my "bot" download a payments report. The important thing to watch out for here is the last 4 digits of what is the confirmation number for each payment. They show up as expected in this report, and when I open the report up in Excel after downloading it. After the report is downloaded, its contents are copied and saved as a new tab in a different workbook and the macro is run on it. The part of the macro I'm having issues with is the formula that takes the last 4 digits of that confirmation number.

    For a reason I can't figure out, the macro is only taking the last 2 digits. It used to take the last 4 digits without any problems, but now that isn't the case. I've also noticed that the actual confirmation number is chopped at the end. In most cases, the last number is off and I can't figure out why that is. I could almost live with the chopped confirmation number, but those last 4 digits are something I absolutely need and I'm not sure why I'm getting the results I am.

    Any suggestions are appreciated, I can provide more media if needed.

    Thank you
    Attached Images Attached Images

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,902

    Re: VBA macro cutting off information

    Either you format the cell to show the 4 digits or save as text , leading zeros don't show
    the idea:

    Please Login or Register  to view this content.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    01-05-2021
    Location
    Scottsdale, AZ
    MS-Off Ver
    Professional Plus 2016
    Posts
    2

    Re: VBA macro cutting off information

    I got them stored as text, whatever you wrote kept giving syntax errors but w/e. But I'm still having the problem of the actual number being altered. Like when I review the whole confirmation number I'm seeing the last digit not showing up.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,902

    Re: VBA macro cutting off information

    My mistake, I typed it right in without checking, the idea is that you pass four 0 and then value and of that the four right characters.
    I understand that you code contains information that you cannot share but try putting something together to share with non-private data, one worksheet at least, makes it easier

    Th image shows the formula in cel E3
    Attached Images Attached Images
    Last edited by Keebellah; 01-05-2021 at 06:27 PM.

+ 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. Macro for searching and cutting and pasting to another sheet
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2018, 03:52 PM
  2. Macro for cutting text
    By michal99 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-14-2015, 08:55 PM
  3. Cutting & Pasting Macro
    By scruz9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2014, 12:39 PM
  4. [SOLVED] Please explain this macro for cutting rows
    By freshfruit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2014, 02:34 PM
  5. [SOLVED] optimize macro - cutting down loops and autofill
    By gwsampso in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2012, 12:56 AM
  6. [SOLVED] Macro for cutting lines from one sheet and adding to another?
    By Oz Dude in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2012, 01:26 AM
  7. [SOLVED] Macro for cutting and pasting by criteria
    By harrydnyc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2011, 12:30 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