ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   scroll automatically as data is imported into a spreadsheet (https://www.excelbanter.com/excel-discussion-misc-queries/222454-scroll-automatically-data-imported-into-spreadsheet.html)

Light Meter Reader

scroll automatically as data is imported into a spreadsheet
 
Hi - is there a way to get Excel to scroll a speadsheet automatically as data
is being imported into it from an external source? I have a lightmeter that
takes readings and sends them to a spreadsheet through external sofware via
RS232. Readings are taken every 0.5 second and being entered into
consecutive cells on a spreadsheet - I want the spreadsheet to scroll
automatically as the data is being transferred. Can this be done? How? I am
using Excel 2003. thanks.

JLatham

scroll automatically as data is imported into a spreadsheet
 
You don't say if the readings are being put into rows or are added into a
column going on down the sheet. I'm assuming that they are going into a
single column (or at least if a series is coming in, something is always
added in one particular column).

The code below may work for you. It is worksheet event code and needs to go
into the module for the worksheet that receives the data. To put it in the
right place, choose that worksheet then Right-click on its name tab and
choose [View Code] from the popup list. Copy the code below and paste it
into the module. Change the constant that is set to = "A" to whatever column
the data comes into. It should work after that change is made. As data
comes into that column, it will scroll up to be at the top of the window.
Hope this helps at least a little.

Private Sub Worksheet_Change(ByVal Target As Range)
Const ColumnDataComesInto = "A" ' change as needed
Dim lastRow As Long
Static lastEntryRow As Long

lastRow = Range(ColumnDataComesInto & Rows.Count).End(xlUp).Row
If lastRow lastEntryRow Then
lastEntryRow = lastRow
Application.Goto _
reference:=Range(ColumnDataComesInto & lastEntryRow), _
scroll:=True
End If
End Sub


"Light Meter Reader" wrote:

Hi - is there a way to get Excel to scroll a speadsheet automatically as data
is being imported into it from an external source? I have a lightmeter that
takes readings and sends them to a spreadsheet through external sofware via
RS232. Readings are taken every 0.5 second and being entered into
consecutive cells on a spreadsheet - I want the spreadsheet to scroll
automatically as the data is being transferred. Can this be done? How? I am
using Excel 2003. thanks.



All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com