A code tweak, or possibly I need a UDF?

Status
Not open for further replies.

London_Calling

Active Member
Joined
Feb 27, 2007
Messages
256
Hi folks,

I'm a real novice with VBA and would just like a little help to tweak my code. This procedure is working with live streamed data, it works very well but I'd like to cannibalise it to help with another issue:
Code:
If Target.Row <> 1 Then Exit Sub
With ThisWorkbook.Worksheets("Data1").Range("C2")
.Copy
End With
With ThisWorkbook.Worksheets("Data2")
.Cells(Rows.Count, "D").End(xlUp).Offset(1, 0).PasteSpecial
End With
Application.CutCopyMode = False
As you can see, it copies data in cell C2 (in sheet Data1), and pastes it in the next empty cell in row D of (sheet Data2).

What I'd like to do now is have the smallest number in the range H5:H34 (of sheet Data1) do the same thing, except paste to the next available cell in row D (I can work that part out though!) - so it's a formula issue rather that a straight 'lift' from another sheet.

I think maybe the streaming data aspect might complicate things. Perhaps I should also mention the data updates once a second.

Perhaps I need to write a user defined function?

Any help most gratefully received. Thanks.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Status
Not open for further replies.

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top