close

Hi,

I have a line of code that identifies the last active row of a
worksheet, ready for a new record to be added.Code:
--------------------Range(quot;A65536quot;).End(xlUp).Offset(1, 0).Select--------------------For example purposes assume that that new row is row 30.

How do I then tell Excel to move to column J in row 30, not stay in
column A?

I cant just change the range selection to J because not all rows have
inputs in row J but all new entries do have a column A entry.--
Alec H
------------------------------------------------------------------------
Alec H's Profile: www.excelforum.com/member.php...oamp;userid=31042
View this thread: www.excelforum.com/showthread...hreadid=522139
Find first empty row in a column
Sub Tst2()
Dim varnbrows As Double
Range(quot;A1quot;).Select
varnbrows = Selection.CurrentRegion.Rows.Count
If Selection.Value = quot;quot; Then
Exit Sub
ElseIf Selection.Offset(1, 0).Value = quot;quot; Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(varnbrows, 0).Select
End If
End Sub

this will take you to the first empty cell in column A

Change the column by changing Range(quot;A1quot;) to whatever column you prefer--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=522139Thank you--
Alec H
------------------------------------------------------------------------
Alec H's Profile: www.excelforum.com/member.php...oamp;userid=31042
View this thread: www.excelforum.com/showthread...hreadid=522139

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()