New row after server data input and copy forumla.

G

Guest

Greeting all, I'm looking for a Macro that will help me out.

Here's my scenario: I have intermittent (maybe every second or spontaneous)
data entered in Excel via an OPC server. The data is entered per row, so I
may have 30 values entered along row 1. The cell's formula may look like
this:
=OPC|TagValues!servername.datavalue
What I'm trying to do is check to see if data has been entered in the row,
if it was entered go to the next row while copying the forumla to the new
row. So basically, the data will propogate down the spreadsheet as the
server sends more data.

Thanks for any help,
Nate
 
G

Guest

I think I made it more complicated sounding than it really is. Nevermind the
data. Can you check for an empty cell? Can you copy the formula from one
cell to the next? All by a Macro?
 
G

Guest

Here's a start, can someone help me with more?

Public Sub CopyDown()
LastRow = Range("A65536").End(xlUp).Row
For i = 1 To LastRow
If Range("A" & i).Value = "" Then
Range("A" & i - 1 & ":CB" & i - 1).Copy Destination:=Range("A" & i)
End If
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top