+ Reply to Thread
Results 1 to 5 of 5

Inserting constant codes a cell

  1. #1
    Registered User
    Join Date
    10-18-2019
    Location
    Cape Town, South Africa
    MS-Off Ver
    2016
    Posts
    2

    Inserting constant codes a cell

    Hi Team,

    I am trying to insert constant codes with the information that is in a cell.

    The information that will be in the file is as it appears in cells A1, A2, A3 in the attached file.

    What I want to know is how to create a function or formula will be saved as a macro that will insert extra values as it appears in cells A11, A12, A13. The inserted values are the ones in color red.

    The raw data file is a new exported different file with same data format.


    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    11,672

    Re: Inserting constant codes a cell

    Hi Manfred

    Welcome to the Forum...I can see why your post has had no responses...
    You have given no exact explanation as what and where the code is supposed to find these constant codes...
    Or... What pattern you would normally follow to manually insert these...
    I am assuming the 2029,In-house, is inserted there as it follows numerically after 2028???

    If that is the case then why is 3195,N, inserted after 3180 but not before the blue snippet also...
    3010,7190781387202008IPA02180132180,3263,59110,3015,IRP5,3020,.....Unless the comma delimited string works in multiples of 2?

    I suggest you upload a sample file with all the possible constants...And an example of each depicting the reasons | or pattern for your insertion...
    Also...You need to describe in detail what your process is as you are surely not wanting this macro copied to all the downloaded files...
    Perhaps the Macro file can be housed in a folder and access all the other files one at a time to edit???
    Last edited by sintek; 10-20-2019 at 07:27 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    11,672

    Re: Inserting constant codes a cell

    This code works for your current upload but I can only assume that you are going to be changing...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 10-20-2019 at 07:30 AM. Reason: Uploaded New File

  4. #4
    Registered User
    Join Date
    10-18-2019
    Location
    Cape Town, South Africa
    MS-Off Ver
    2016
    Posts
    2

    Re: Inserting constant codes a cell

    Hi all,

    The pattern which the code is supposed to find these constant codes is that it should search in the string and find code constant code 2028 with its value In-house after insert 2029 with the value In-house, thereafter should search for code 2035 and its value then insert 2036 with value Rensburg as well as code 2037 with value N as these two codes follow each other

    This code will be for the top line only call A1 and the constant code to be inserted are indicated below:
    '2029' 'In house'
    '2036' 'Rensburg'
    '2037' 'N'

    The same procedure as on top should be followed to insert the constant to the rest of the cells in the queue from cell A2 to the cell second from last on the queue.
    In these cells the code should search for code 3180 and its value and insert 3195 with value N thereafter should search for code 3217 and its value then insert 3220 with value N

    '3195 'N'
    '3220' 'N'

    So basically what is needed is the two codes; one to run on the top line and the second to run on all the rest of the lines. The code uploaded on the response is working fine just that its the code 3195 and its value to be removed and add code '2037' 'N' and the code to run the rest of the lines.

    Thanks

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    20,769

    Re: Inserting constant codes a cell

    Try
    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 11-11-2015, 04:26 AM
  2. Replies: 1
    Last Post: 09-18-2013, 01:58 PM
  3. [SOLVED] Compile error: Constant expression required error when merging two Codes
    By Kezwick in forum Outlook Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2013, 09:32 AM
  4. [SOLVED] macro codes for inserting formula to various similar worksheets
    By rohit43 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-21-2013, 10:17 AM
  5. Constant cell
    By dbkss01 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-17-2009, 08:08 AM
  6. Replies: 6
    Last Post: 11-28-2006, 01:08 PM
  7. [SOLVED] Constant cell
    By Aurora in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2006, 11:15 AM

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