ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   New row always on top (https://www.excelbanter.com/setting-up-configuration-excel/160333-new-row-always-top.html)

deniseh

New row always on top
 
I used an Excel spreadsheet to track my daily notes. 1st column is the date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise

Bob Phillips

New row always on top
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C2" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Rows(2).Insert
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deniseH" wrote in message
...
I used an Excel spreadsheet to track my daily notes. 1st column is the
date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I
finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise




deniseh

New row always on top
 
Thank you for the quick response Bob. However; the message is a bit coded and
I don't think I understand what you are instructing me to do.

Forgive me but, could you please provide clearer intructions as to what I
need to do?

Thank you,

deniseH

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C2" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Rows(2).Insert
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deniseH" wrote in message
...
I used an Excel spreadsheet to track my daily notes. 1st column is the
date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I
finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise





Bob Phillips

New row always on top
 
Denise,

the instructions are included after the code.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deniseH" wrote in message
...
Thank you for the quick response Bob. However; the message is a bit coded
and
I don't think I understand what you are instructing me to do.

Forgive me but, could you please provide clearer intructions as to what I
need to do?

Thank you,

deniseH

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C2" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Rows(2).Insert
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"deniseH" wrote in message
...
I used an Excel spreadsheet to track my daily notes. 1st column is the
date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I
finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise







deniseh

New row always on top
 
Wow, what a learning experience. An IT person helped me with your
instructions and it works!! Thank you so much for your help!

"Bob Phillips" wrote:

Denise,

the instructions are included after the code.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deniseH" wrote in message
...
Thank you for the quick response Bob. However; the message is a bit coded
and
I don't think I understand what you are instructing me to do.

Forgive me but, could you please provide clearer intructions as to what I
need to do?

Thank you,

deniseH

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C2" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Rows(2).Insert
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"deniseH" wrote in message
...
I used an Excel spreadsheet to track my daily notes. 1st column is the
date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I
finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise







Bob Phillips

New row always on top
 
Denise,

That was my standard set of instructions. What was unclear with it, help me
to make it better?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deniseH" wrote in message
...
Wow, what a learning experience. An IT person helped me with your
instructions and it works!! Thank you so much for your help!

"Bob Phillips" wrote:

Denise,

the instructions are included after the code.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"deniseH" wrote in message
...
Thank you for the quick response Bob. However; the message is a bit
coded
and
I don't think I understand what you are instructing me to do.

Forgive me but, could you please provide clearer intructions as to what
I
need to do?

Thank you,

deniseH

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C2" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Rows(2).Insert
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"deniseH" wrote in message
...
I used an Excel spreadsheet to track my daily notes. 1st column is
the
date,
next is the company or the person I've spoken to and column 3 is the
corresponding notes.

I would like to have an new row pop up under my headings each time I
finish
an entry.

Does anybody know how that may be set up?

Thank you,

Denise










All times are GMT +1. The time now is 04:45 PM.

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