VBA Display In Selected Cell
Closed
azmiismail
Posts
17
Registration date
Thursday 3 March 2011
Status
Member
Last seen
20 July 2011
-
17 Mar 2011 à 07:00
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 17 Mar 2011 à 14:24
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 17 Mar 2011 à 14:24
Related:
- VBA Display In Selected Cell
- Vba select case like - Guide
- Clear only the formatting from the selected cell - Guide
- Excel online vba - Guide
- Vba color index - Guide
- Vba timer - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
17 Mar 2011 à 08:42
17 Mar 2011 à 08:42
could you please re-explain your issue with some exaple
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.
Note: your data need not be to be real data but a good representative of how data looks like
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.
Note: your data need not be to be real data but a good representative of how data looks like
17 Mar 2011 à 10:24
17 Mar 2011 à 10:53
Sub Find_Info() Dim FindString As String 'declaring variable FindString of type string Dim Rng As Range 'declaring variable Rng of type range ' display the input box to ask the staff number FindString = InputBox("Name or Staff Number") 'check to see if non-white space character were entered If Trim(FindString) <> "" _ Then ' on sheet MAC 11, within range defined by column A through CZ, With Sheets("MAC 11").Range("A:CZ") 'locate the cell that constains the sting that is being search Set Rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not Rng Is Nothing _ Then ' if a cell was found, then goto the cell that was located 'Application.Goto Rng, True ' on MAC 11, at cell B19, put the value that is found in same coulmn but one row above ' OFFSET(offset by how many rows, offset by how many colums) is format Sheets("MAC 11").Cells(19, "B") = Rng.Offset(-1, 0) Else 'if no cell was found MsgBox "Not listed" End If End With End If End Sub17 Mar 2011 à 13:33
17 Mar 2011 à 13:35
17 Mar 2011 à 14:24
Rng.Row will give you the row number where the match occured. Now you have to see if it is an odd number or a even number and then act according.