Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.excel.programming > #107931
| Subject | Re: Macro to paste from clipboard |
|---|---|
| References | <t7-dnW0Rv_aewibInZ2dnUU78audnZ2d@brightview.co.uk> <mpi2a4$ng$1@dont-email.me> |
| Newsgroups | microsoft.public.excel.programming |
| From | F <news@nowhere> |
| Date | 2015-08-03 10:52 +0100 |
| Message-ID | <sP2dnaTfVJ-jpyLInZ2dnUU78LmdnZ2d@brightview.co.uk> (permalink) |
On 01/08/2015 10:09, Claus Busch wrote:
> Hi,
>
> Am Fri, 31 Jul 2015 12:40:39 +0100 schrieb F:
>
>> I've struggled, and failed, to write a macro to automate this. Can
>> anyone help?
>
> why don't you write the values into C:F? Then you don't have to copy &
> paste values. Paste the new data to K:L and then run the macro.
>
> Sub Test()
> Dim dest As Range
>
> With ActiveSheet
> Set dest = .Cells(Rows.Count, 3).End(xlUp)(2)
> dest = Evaluate("=IF(INDEX($K$8:$K$151,MATCH(MAX($L$8:$L$151),$L$8:$L$151,0))" _
> & "<>""00:10"",INDEX($K$8:$K$151,MATCH(MAX($L$8:$L$151),$L$8:$L$151,0)),""No output"")")
> dest.Offset(, 1) = Evaluate("=MAX($L$8:$L$151)")
> dest.Offset(, 2) =
> Evaluate("=INDEX(K8:K80,MATCH(TRUE,L8:L80<>0,0))")
> dest.Offset(, 3) =
> Evaluate("=INDEX(K81:K151,MATCH(TRUE,L81:L151=0,0))")
> End With
> End Sub
>
>
> Regards
> Claus B.
Hi Claus
Many thanks for that.
It works really well except I had not realised it was relevant to say
that there is data in A36:E40 and so the macro is writing the values
into C41:F41 and below.
Is there a solution which ignores the presence of the data in A36:E40
and so start writing in C4:F4 (the first empty area above A36:E40) and
then subsequent rows?
Regards
--
Frank
Back to microsoft.public.excel.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Macro to paste from clipboard Claus Busch <claus_busch@t-online.de> - 2015-08-01 11:09 +0200
Re: Macro to paste from clipboard F <news@nowhere> - 2015-08-03 10:52 +0100
Re: Macro to paste from clipboard Claus Busch <claus_busch@t-online.de> - 2015-08-03 12:07 +0200
Re: Macro to paste from clipboard Claus Busch <claus_busch@t-online.de> - 2015-08-03 12:12 +0200
Re: Macro to paste from clipboard Claus Busch <claus_busch@t-online.de> - 2015-08-03 12:20 +0200
Re: Macro to paste from clipboard F <news@nowhere> - 2015-08-03 12:01 +0100
Re: Macro to paste from clipboard Claus Busch <claus_busch@t-online.de> - 2015-08-03 13:12 +0200
csiph-web