Programming Challenges!

L

Loretta

I have a spreadsheet set up for the purpose of data entry via an external
data collection device. The spreadsheet consists of a header row: Serial No.,
Dim #1-Dim #16, Average, Range. I need a macro to run automatically upon
opening the worksheet that will position the cursor in the first empty Dim #1
(Column B) cell. Upon entry of the 16th pc of data, I need the cursor to
reset to the Dim #1 (Column B) in the next row. Also, I would like to set the
spreadsheet to either autosave within the macro that resets the cursor or
autosave every X minutes.

Anyone?
 
D

Don Guillett

I, for one due to old age I guess, don't understand but if you want send
your workbook to my address below along with a snippet of this msg copied
into a newly inserted sheet.
 
A

AndyM

Hi,

Try pasting the following code into the ThisWorkbook module. On open, this
code will find the first empty cell within column 2 (Column B). On any
worksheet change, it will check if the cell changed was in column 17 (Column
Q, Dim#16). If so, it will select the following row in column B.

Hope this helps!
Andy

Private Sub Workbook_Open()
Dim row As Long
row = 1
Do Until Trim(Cells(row, 2).Value) = ""
row = row + 1
Loop
Cells(row, 2).Select
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 17 Then
ActiveWorkbook.Save
Cells(Target.row + 1, 2).Select
End If
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