Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Worksheet change code

Hi Todd

try
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Counter As Long
Dim Location

Counter = Application.WorksheetFunction.CountA(me.Range
("K:K"))

On Error Resume Next
Set myRange = Intersect(Range("K2:K" & Counter), Target)
If Not myRange Is Nothing Then
target.Offset(0, 15).Select
SendKeys "%{down}"
End If
End Sub


-----Original Message-----
hey guys

Below is a code that is supposed to sendkeys to a certain
cell if a change is made in the specified range.

However,
it does not work. Can anyone tell me whats wrong? When

I
change a cell in the specified cells, nothing happens.

If
I change the event to the worksheet_SelectionChange, it
works but it never gives me the chance to enter anything
into the cell I want to.

Can anyone tell me whats wrong?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Counter As Long
Dim Location

Counter = Application.WorksheetFunction.CountA(Worksheets
(1).Range("K:K"))
Location = ActiveCell.Address

On Error Resume Next
Set myRange = Intersect(Range("K2:K" & Counter), Target)
If Not myRange Is Nothing Then
Range(Location).Offset(0, 15).Select
SendKeys "%{down}"
End If
End Sub


Thanks
Todd Huttenstine
.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Worksheet change code

Ah yes, thank you.

Todd
-----Original Message-----
Hi Todd

try
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Counter As Long
Dim Location

Counter = Application.WorksheetFunction.CountA(me.Range
("K:K"))

On Error Resume Next
Set myRange = Intersect(Range("K2:K" & Counter), Target)
If Not myRange Is Nothing Then
target.Offset(0, 15).Select
SendKeys "%{down}"
End If
End Sub


-----Original Message-----
hey guys

Below is a code that is supposed to sendkeys to a

certain
cell if a change is made in the specified range.

However,
it does not work. Can anyone tell me whats wrong? When

I
change a cell in the specified cells, nothing happens.

If
I change the event to the worksheet_SelectionChange, it
works but it never gives me the chance to enter anything
into the cell I want to.

Can anyone tell me whats wrong?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Counter As Long
Dim Location

Counter = Application.WorksheetFunction.CountA(Worksheets
(1).Range("K:K"))
Location = ActiveCell.Address

On Error Resume Next
Set myRange = Intersect(Range("K2:K" & Counter), Target)
If Not myRange Is Nothing Then
Range(Location).Offset(0, 15).Select
SendKeys "%{down}"
End If
End Sub


Thanks
Todd Huttenstine
.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change the pivot chart automaticaly as values in the worksheet change Vinay Vasu Excel Worksheet Functions 0 May 3rd 10 04:25 PM
change formula in a shared worksheet without losing change history DCE Excel Worksheet Functions 5 July 25th 08 01:37 PM
change the name of a worksheet/update VBA code Dave F[_2_] Excel Discussion (Misc queries) 1 June 8th 07 09:22 PM
Enable/Disable Worksheet Change Event code Stuart[_5_] Excel Programming 2 November 3rd 03 07:22 PM
Copy Sheets minus Worksheet Change Event code & Macro Buttons Bob[_36_] Excel Programming 0 October 8th 03 01:17 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"