Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA code if/then

i would to create VBA code that will bring up a dialogue box if the
words "TOOL ASSEMBLY" are input under column "F". I would like to
place certain words A, B, C, D whatever in a corresponding column on
the same row. Is this possible? any help is greatly appreciated,
thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default VBA code if/then

Certainly possible using sheet event code.

Who/what decides which certain words(or whatever) are placed in the adjacent
column.

Some code to place values in column G at each row where "tool assembly" is input

Not case-sensitive.............

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col F
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 6 Then
n = Target.Row
If Excel.Range("F" & n).Value = "TOOL ASSEMBLY" Then
Excel.Range("G" & n).Value = "A, B, C, D or whatever"
End If
End If
enditall:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP



On Mon, 4 Apr 2011 09:41:11 -0700 (PDT), john taiariol
wrote:

i would to create VBA code that will bring up a dialogue box if the
words "TOOL ASSEMBLY" are input under column "F". I would like to
place certain words A, B, C, D whatever in a corresponding column on
the same row. Is this possible? any help is greatly appreciated,
thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA code if/then

On Apr 4, 3:12*pm, Gord Dibben wrote:
Certainly possible using sheet event code.

Who/what decides which certain words(or whatever) are placed in the adjacent
column.

Some code to place values in column G at each row where "tool assembly" is input

Not case-sensitive.............

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col F
On Error GoTo enditall
* * Application.EnableEvents = False
If Target.Cells.Column = 6 Then
* * * * n = Target.Row
* * * * If Excel.Range("F" & n).Value = "TOOL ASSEMBLY" Then
* * * * * * Excel.Range("G" & n).Value = "A, B, C, D or whatever"
* * * * End If
* * End If
enditall:
* * Application.EnableEvents = True
End Sub

Gord Dibben * * MS Excel MVP

On Mon, 4 Apr 2011 09:41:11 -0700 (PDT), john taiariol
wrote:



i would to create VBA code that will bring up a dialogue box if the
words "TOOL ASSEMBLY" are input under column "F". I would like to
place certain words A, B, C, D whatever in a corresponding column on
the same row. Is this possible? any help is greatly appreciated,
thanks.- Hide quoted text -


- Show quoted text -


this works great thanks. just one thing, is it possible to look for a
column heading such as "Name" instead of column "F", thanks again for
the help.
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
Creating excel file, adding code to it from code, VBE window stays BlueWolverine Excel Programming 0 November 5th 09 07:55 PM
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM


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