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

Hi,

Perhaps something like this may help.

Code:
Sub test()
Application.ScreenUpdating = False
Dim myrng As Range

For Each myrng In Sheets("Sheet1").Range("F2:F" & Sheets("Sheet1").Range("F65536").End(xlUp).Row)
    If Sheets("Sheet1").Cells(myrng.Row, 6).Text = "TOOL ASSEMBLY" Then
        MsgBox "Tool Assembly"
        Sheets("Sheet1").Cells(myrng.Row, 1).Value = "Test"
        Sheets("Sheet1").Cells(myrng.Row, 2).Value = "Test1"
        Sheets("Sheet1").Cells(myrng.Row, 3).Value = "Test2"
        Sheets("Sheet1").Cells(myrng.Row, 4).Value = "Test3"
    End If
Next
End Sub
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
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
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
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
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


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