Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi guys!,
Im trying to get a macro to select a cell containing the text "shift in cells to the right on the same row when a maro is run and not foun a match in a list i have created, i can get it to work to a fashion bu it throws up a "define" error...can anyone help?....i can send you th test book that im working on, the code is in "this workbook" module o worksheets...i also want to select all sheets in the work book whe this macro is run. I might be being a little sketchy on what i want, so if u need mor info drop me a line, and i will try to explain or send u the testbook. Cheers! Simon Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVa Target As Range) Dim myrange As Range Dim isect As Range If Sh.Name = "Hidden" Then Exit Sub Set myrange = Sh.Range("E1:G20") Set isect = Application.Intersect(myrange, Target) If isect Is Nothing Then Exit Sub End If Dim t1 As String Dim I1 As Integer Dim res As Variant Dim txt As Variant t1 = InputBox("name", "input", "") With Worksheets("Hidden") res = Application.Match(t1, .Range(.Range("A2"), _ .Range("A2").End(xlDown)), 0) End With If Not IsError(res) Then ActiveCell = t1 ActiveCell.Offset(1, 0).Activate Exit Sub 'Worksheets("hidden").Visible = False End If 'Next I2 I1 = MsgBox("Please try again " & Chr(13) & "Skill " & " Entry no recognised " & "Please Contact Training Dept to Add Skill Title!!") 'If I1 = 1 Then 'Do Until ActiveCell = "shift " '& txt 'ActiveCell.Offset(0, -1).Select If ActiveCell = (0) Then 'Do 'ActiveCell.Offset(0, -1).Select 'ActiveCell = xlToLeft Range(ActiveCell, ActiveCell.End(xlToLeft). 'Loop Until ActiveCell = "shift " & txt I have tried some other scenarios as you can see but i have commente them out! -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Offsetting | Excel Discussion (Misc queries) | |||
Offsetting a formulas result. | Excel Worksheet Functions | |||
Offsetting the vlookup function | Excel Discussion (Misc queries) | |||
Offsetting and HLOOKUP | Excel Worksheet Functions | |||
offsetting periods in chart | Excel Discussion (Misc queries) |