VBA Display In Selected Cell
Closed
azmiismail
Posts
17
Registration date
Thursday March 3, 2011
Status
Member
Last seen
July 20, 2011
-
Mar 17, 2011 at 07:00 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 17, 2011 at 02:24 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 17, 2011 at 02:24 PM
Related:
- VBA Display In Selected Cell
- Vba select case like - Guide
- Clear only the formatting from the selected cell - Guide
- Excel online vba - Guide
- Computer turns on but no display - Guide
- Vba timer - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 17, 2011 at 08:42 AM
Mar 17, 2011 at 08:42 AM
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
Mar 17, 2011 at 10:24 AM
Mar 17, 2011 at 10:53 AM
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 SubMar 17, 2011 at 01:33 PM
Mar 17, 2011 at 01:35 PM
Mar 17, 2011 at 02:24 PM
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.