![]() |
help needed offsetting until text
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 |
help needed offsetting until text
If anyone wants to post seperate portions of the ode amendments i wil
endeavour to marry them up myself! Cheers! Simo -- Message posted from http://www.ExcelForum.com |
help needed offsetting until text
Well i have managed to get excel to move left after performing a tas
using selection.end(xltoleft).select but when it hits a cell containin text it stops anyone know how to get over this hurdle?, i have als sorted out the select multisheet while performing task and turn of after. Any help with the "move to column A same row as active cell" wil b greatly appreciated! Thanks Simo -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 10:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com