+ Reply to Thread
Results 1 to 3 of 3

Hardcode Values, find and replace multiple strings

  1. #1
    Registered User
    Join Date
    05-16-2020
    Location
    Lima
    MS-Off Ver
    2019
    Posts
    25

    Hardcode Values, find and replace multiple strings

    Hello, Guys!

    I need to write code to do the following:

    1. Copy the entire worksheet named "live" and paste special values (hard-code the lives worksheet).
    2. delete rows A1:A7
    3. Find the following strings and replace with nothing ""
    What:=" 4:00:00 PM", Replacement:=""
    What:=" 5:40:00 PM", Replacement:=""
    What:=" 3:16:00 PM", Replacement:=""

    Please note the space at the beginning of each string. It's probably easier to copy and paste what I wrote to minimize an error.

    So far, I've come up with this, but I am sure there is a more succinct way of doing it.

    I've attached the file.

    Thank you!

    J

    Sub CopyPasteValues()

    Sheets("live").Cells.Copy
    Sheets("live").Cells.PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False

    Range("A1:A7").EntireRow.Delete


    ' I CANNOT FIGURE OUT THE REPLACE SECTION


    End Sub
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Hardcode Values, find and replace multiple strings

    Something like this.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-16-2020
    Location
    Lima
    MS-Off Ver
    2019
    Posts
    25
    Thank you!




    Quote Originally Posted by jindon View Post
    Something like this.
    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. [SOLVED] Find and Replace Strings Within Modules Using Macro (Without Using Find Dialog)
    By exceere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2020, 09:08 PM
  2. [SOLVED] Find Multiple Text Strings in Column, return the 9 cell strings below
    By BoExcels in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-05-2019, 09:56 AM
  3. Need a Find and Replace Function with Multiple Text Strings
    By satyanarayana in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2019, 08:33 AM
  4. Replies: 1
    Last Post: 04-26-2018, 10:06 AM
  5. Moved to commercial services forum.
    By Midnight-Oil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2015, 01:05 PM
  6. Multiple Find and Replace to replace a list of strings
    By WalterP34 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2011, 07:41 PM

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