Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Abi Abi is offline
external usenet poster
 
Posts: 20
Default VB script and disappearing information

I'm using the following script to make it easier on users when they enter
data. Instead of them having to tpye "One-Man" or "Two-Man" they type 1 or 2
and it the coinciding phrase appears instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Range("B208") = 1 Then
Range("B208") = "One-Man"
ElseIf Range("B208") = 2 Then
Range("B208") = "Two-Man"
Else
Range("B208") = ""
End If
Application.EnableEvents = True
End Sub

The users are entering data in the B column of one sheet and that info
filters through to other sheets. The one-man two-man info is entered into
B208. Directly below that are other cells that need to have information
entered into them. However, when I enter the information in cell B209, or
B210, etc., it deletes the information out of cell B208.

Can anyone tell me what's going on, and how I can fix it? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB script and disappearing information

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.count 1 then exit sub
if Target.Address = "$B$208" then
Application.EnableEvents = False
If Range("B208") = 1 Then
Range("B208") = "One-Man"
ElseIf Range("B208") = 2 Then
Range("B208") = "Two-Man"
Else
Range("B208") = ""
End If
Application.EnableEvents = True
End If
End Sub

--
Regards,
Tom Ogilvy

"Abi" wrote in message
...
I'm using the following script to make it easier on users when they enter
data. Instead of them having to tpye "One-Man" or "Two-Man" they type 1

or 2
and it the coinciding phrase appears instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Range("B208") = 1 Then
Range("B208") = "One-Man"
ElseIf Range("B208") = 2 Then
Range("B208") = "Two-Man"
Else
Range("B208") = ""
End If
Application.EnableEvents = True
End Sub

The users are entering data in the B column of one sheet and that info
filters through to other sheets. The one-man two-man info is entered into
B208. Directly below that are other cells that need to have information
entered into them. However, when I enter the information in cell B209, or
B210, etc., it deletes the information out of cell B208.

Can anyone tell me what's going on, and how I can fix it? Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
Abi Abi is offline
external usenet poster
 
Posts: 20
Default VB script and disappearing information

Thank you!

"Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.count 1 then exit sub
if Target.Address = "$B$208" then
Application.EnableEvents = False
If Range("B208") = 1 Then
Range("B208") = "One-Man"
ElseIf Range("B208") = 2 Then
Range("B208") = "Two-Man"
Else
Range("B208") = ""
End If
Application.EnableEvents = True
End If
End Sub

--
Regards,
Tom Ogilvy

"Abi" wrote in message
...
I'm using the following script to make it easier on users when they enter
data. Instead of them having to tpye "One-Man" or "Two-Man" they type 1

or 2
and it the coinciding phrase appears instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Range("B208") = 1 Then
Range("B208") = "One-Man"
ElseIf Range("B208") = 2 Then
Range("B208") = "Two-Man"
Else
Range("B208") = ""
End If
Application.EnableEvents = True
End Sub

The users are entering data in the B column of one sheet and that info
filters through to other sheets. The one-man two-man info is entered into
B208. Directly below that are other cells that need to have information
entered into them. However, when I enter the information in cell B209, or
B210, etc., it deletes the information out of cell B208.

Can anyone tell me what's going on, and how I can fix it? Thanks!




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
Pivot table cutting information of a part of the information ASR Excel Discussion (Misc queries) 1 November 5th 09 02:09 PM
Disappearing Data Deborah Excel Discussion (Misc queries) 1 January 23rd 09 06:01 PM
Add-Ins Disappearing? Ben Excel Discussion (Misc queries) 3 July 18th 05 10:39 AM
disappearing worksheets sbp[_2_] Excel Programming 0 May 26th 04 03:46 AM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM


All times are GMT +1. The time now is 07:18 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"