Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #110366

Re: Code to replace specific text

From Bruno Campanini <brunocam@libero.it>
Newsgroups microsoft.public.excel.programming
Subject Re: Code to replace specific text
Date 2017-11-19 04:53 +0100
Organization Aioe.org NNTP Server
Message-ID <ouqv7c$fmo$1@gioia.aioe.org> (permalink)
References <82cd76b0-fd71-4b6f-aa8f-5a4465c93c6e@googlegroups.com>

Show all headers | View raw


After serious thinking crankylemming@googlemail.com wrote :
> Hi
>
> I'm wondering if anyone could advise me on this.
>
> Within a worksheet detailing business credit card purchases, I have 2 columns 
> which list a description of the purchase (col G) and the name of the vendor 
> (col H)
>
> I'm currently working on a macro that sorts the worksheet by various 
> criteria, and I want to include in the same macro an element of tidying the 
> data so that, if the 'description' cell says 'No Description' (this is from 
> the credit card source data), I'd like to replace it with the content of the 
> corresponding vendor cell:
>
> Col G           Col H
> Laptop          PC Store
> No Description  PC Store
> Keyboard        Amazon
>
> becomes
>
> Col G           Col H
> Laptop          PC Store
> PC Store        PC Store
> Keyboard        Amazon
>
> And I'm completely stumped on how to do it.

======================================
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel 
As Boolean)

If Not IsEmpty(Target) And Target(, 0) = "No Description" Then
    Target(, 0) = Target
End If

End Sub
=======================================

DoubleClick a non-blank cell to the right of "No Description".

Bruno

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Code to replace specific text crankylemming@googlemail.com - 2017-11-17 07:26 -0800
  Re: Code to replace specific text Claus Busch <claus_busch@t-online.de> - 2017-11-17 16:34 +0100
  Re: Code to replace specific text crankylemming@googlemail.com - 2017-11-17 08:30 -0800
    Re: Code to replace specific text Claus Busch <claus_busch@t-online.de> - 2017-11-17 17:43 +0100
      Re: Code to replace specific text GS <gs@v.invalid> - 2017-11-17 12:54 -0500
  Re: Code to replace specific text Bruno Campanini <brunocam@libero.it> - 2017-11-19 04:53 +0100

csiph-web