Find The Last Cell In A Col With A Specific Value
Hi all,
say I have a list of values in a Column in a worksheet that looks something like:
Blah Rhubarb
Twaddle 07981 07944 07866 Drivel
Fluff
Does anyone know a quick way to find the ROW NUMBER of the last value that starts 079? Obviously I can loop and stuff, but I was wondering if there was some in-built function that would do this. I have to do this sort of test many times, and looping and testing all the cells seems like a good way to slow this thing to a crawl.
Cheers in advance J.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Find Cell, If X=true, Edit Cell One To The Left
Howdy..
The title pretty much says it all.
What I am trying to do is if, lets say, cell B2 contains "bar" anywhere in it, I want cell A2 to have "BAR" written in it.
Since the last time I did Visual Basic was in grade 10, and it was very basic (hehehe pun) material, I am somewhat lost here.
Thank you,
Vladicus
Find A Cell Then Plot Data To And Including The Cell
I have a sheet with two large columns of numbers, one of which starts out as a large positive and then goes to zero and then to negative numbers. I have successfully coded a method to locate the zero cell, now what I want to do is select the data from the top of the column (AW3) to the cell with the zero (who's location is known) automatically for the xvalue range in a chart. I don't want to do this manually as the zero cells moves for different configurations.
Sample of code I'm currently working on:
Code:
Sub Button38_Click()
'This button locates the address of the cell I'm looking for.
Dim c As Range
Dim firstAddress As String
With Worksheets(2).Range("AW3:AW300")
Set c = .Find("0.00", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Worksheets(2).Range("BA1").Value = firstAddress
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Worksheets(2).Range("BB1") = c
End Sub
'I now have a cell reference say $AW$72 in cell BA1, and the value 0.00 in cell BB1
'The next sub is to graph with a range of xvalues from AW3 to the cell found above,
'AW72 in this case.
Sub Graphs_Button1_Click()
Sheets("Intermediate Calculations").Select
'I'm just using minScale to scale the x-axis on the chart
Dim minScale As Single
minScale = Range("AY3")
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
'The ??? are where I want to make the cell reference the one I've found above, ie. AW72
'for the Xvalues and a corresponding row 72 for the y value column.
ActiveChart.SeriesCollection(1).XValues = "='Intermediate Calculations'!R3C51:???????"
'ActiveChart.SeriesCollection(1).XValues = "='Intermediate Calculations'!R3C51:R72C51"
'The above line works but I don't want to have to manually input the R72C51 part.
ActiveChart.SeriesCollection(1).Values = "='Intermediate Calculations'!R3C49:R?????C49"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Graphs"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Crack Size, mm"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Remaining Life, h"
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
With ActiveChart.Axes(xlCategory)
.MinimumScale = minScale
.MaximumScaleIsAuto = True
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
End With
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "0.0E+00"
ActiveChart.Axes(xlCategory).Select
End Sub
How Do I Get VB To Go To The Last Cell, Not A Specific Cell
sorry guys, im sure this isnt rocket science to you, but this is driving me mad!
The below is a section of code im writing, but the basic principal i am trying to achieve is to go to the bottom of a list of data and then autosum. The thing is i dont want it to use a specific cell, as the amount of data in the column will change.
What am i doing wrong?
Columns("K:K").Select
Selection.FindNext(After:=ActiveCell).Activate
Columns("K:K").Select
Range("K100").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-98]C:R[-1]C)"
Columns("K:K").Select
Range("K100").Activate
Thanks Dom
Value Of Specific Cell In DataGrid
Hi!
i am displaying data in a DataGrid. In Click()event i want to get the column(0).value, column(1).value and column(3).value in to variables , of that row. Then i have to open a recordset, these 3 variables as parameters.
Code:Private Sub grdDataGrid_Click()
Dim sCurAccType$, sCurTaxType$, sStatus$
Set rsShowDetails = New ADODB.Recordset
sCurAccType = grdDataGrid.Columns(0).Text 'Account_Type
sCurTaxType = grdDataGrid.Columns(1).Text 'Tax_Type
sStatus = grdDataGrid.Columns(3).Text 'Status
rsShowDetails.Open ("SELECT * FROM tbl_TransDetails WHERE Account_Type = '" & sCurAccType & "'" _
& " AND Tax_Type= '" & sCurTaxType & "'" _
& " AND Status = '" & sStatus & "'" _
& " AND Entry_Date = #" & cmbEntryDate.text & " # " )
Me.Hide
Show frmShowDetails
End Sub
I tried with the above code. It is getting values, but with the first row of data. but i want to get values of the row i clicked. Please help me.
Thanks!
>>>>>>>>>>>>>>
Edited by - sreddy on 3/22/2005 8:04:45 AM
Run Macro On Specific Cell Change
Is there a way to have a VB Macro run when a specific cell changes value ? I am able to have a macro run when a "sheet data change" takes place, but do not know how to isolate a specific cell to be watched, while ignoring any other changes to the sheet.
Thanks in advance for any help !!!
Select Specific Cell Range
Microsoft Excel 2003
Microsoft Visual Basic 6.3
Hello,
I am trying to make my macro select a range of cells whose row numbers are calculated within the macro.
Unfortunately the method I used doesn't seem to work, it tells me there is a 'Run time error 1004' and the debugger goes to the offending line (the second line of code shown below).
I originally recorded the macro, and then edited it to be able to automatically select a different range.
I originally had:
Range("B34:B37").select
And changed it to:
Range("B[(p + 1) - (r - 1)]:B[p + 1]").select
p & r are both defined beforehand and set equal to numeric values which depend on certain other factors.
This is probably a ridiculous way of going about it and I know very little about programming, but if anyone knows the correct way then I could REALLY use some help.
Thanks,
Henry
To Copy Specific Cell From 2 Workbook
Hi,
I would like to copy specific cell data from 2 workbook to another workbook(which is already existing).I am using VBA for excel. I would like to have the commands button only on the first workbook, without opening the 2nd and 3rd workbook. Can i fetch a cell data from 2nd workbook and write to the 3rd workbook.
Thanks in advance.
How To Set Focus To Specific Cell In A Datagrid?
Hello brainy people,
I love this place because there are so many brainier people than me here. I can usually find answers to my insignificant little problems with a simple search. But this time I need to post.
I have a datagrid (datagrid1) on my form which is linked to an ADO recordset (rsProductCosts). To validate the data entered by the client I use the sub Datagrid1_Validate to loop through the recordset and check that each required column has been completed and it's contents confirm to the required datatype. The point at which I am having a problem is passing focus back to the relevant cell of datagrid1 when the data doesn't pass validation. The validate method automatically returns focus to the datagrid but not to the cell which requires action by the client. I have tried the following;
rsProductCosts.AbsolutePosition = currentrow
DataGrid1.col = currentcol
but I can't seem to get it to work. Is it even possible.
Regards
JohnFromPerth
Accessing A Specific Cell In A DataGrid?
Hi,
I have a datagrid hooked up to a MySQL database. I was wondering how I can access a specific row, column, or cell. For example, say I have 3 columns (id, name, and age) and 2 rows. If I wanted to get the name located in Row 2 Column 2, and set the caption of a label in my form to this name in Row 2 Column 2, how do I do it?
Thanks!
How To Set The Value To Specific Cell In DataGrid By Programmin?
I use VB 6 to implement project codes which use Datagrid to present information from database. The Datagrid allows user to modify, delete and add information and under some events I want to set value in specific cell by code such as at cell of first column and third row. How to do it? Thanks!
** RESOLVED ** Boldface Specific Cell In Flexgrid. Possible ?
Can anyone tell me what combination of .Cell, .Row, .Rowsel, .Colsel I ned to boldface a specific cell i a flexgrid ?
Ideally I would like to boldface specific rows.
I know it can be done, I just haven't hit the right combination yet, and its doing my head in
Insert Information Into A Specific Datagrid Cell
I am using a datagrid connected to an SQL server via an ADO connection.
I need to be able to insert a value into a hidden datagrid field via code. How can I do this?
Example:
I am displaying the data in a datagrid. I have set the visibility of the Payrate field to false, for security purposes. Now what I want to happen via code. When the user adds a record to the datagrid they enter the machine number in it's cell. I will use an SQL statment to get the payrate for that particular machine. (I can get this to work). Now for the real problem. How can I set the payrate cell in the added record to the payrate for that machine number.
If this is not clear e-mail me or post any questions you have of me.
If anyone can help with this... I thank YOU.
Problem To See Specific Data In Excel Cell Via VB6
Hello all,
I have a very wierd problem.
I have an Excel file, that looks normaly
I have data in the cells. that I can see while activate the
Excell Program, can manipulate that data... like Cut paste ac..
But when I go into my VB project..
Some of the Cells I see an NULL.. its a problematic subject for me..
I tried it all...can somebody help me????/
This is the code and attach is the Excell file.
The file is Excell2000. Maybe I open the File incorrect in VB..?
Maybe Do you have some triks that I can do?
When I use the Record Count I see all Records.
When I go on F3 some of the Data apears as NULL
(For example : 18112 on its second apearence) even thou I
can see the Data on the excel program.
Thanks in Adnvace
Eran.
Here is the Code:
Public Function fOpen_ConnDBExcelFrmActive()
'Connect to the Excel DB
'Created by Rinat Sade - iDnext Ltd.
'
On Error GoTo function_error
Dim objData As New CDBData
Dim pszConnection As String
Dim pszDataBase As String
Set objCn = New ADODB.Connection
If objCn.State = adStateOpen Then
If objRs.status = 1 Then
objRs.Close
Set objRs = Nothing
End If
objCn.Close
End If
Dim glTheError As Long
'get string connection
'Paste the correct Excel File here !!
pszDataBase = frmActiveForm.txtExcelFile.Text
'glTheError = objData.fGetDBConnection(11, pszDataBase, "")
pszConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & pszDataBase & _
"; Extended Properties=""Excel 8.0;HDR=No;"""
'Open connection
objCn.Open pszConnection
Set objData = Nothing
Dim pszString As String
Set objRs = New ADODB.Recordset
If objRs.State = adStateOpen Then
objRs.Close
End If
objRs.CursorType = adOpenStatic
' Use client cursor to allow use of
' AbsolutePosition property.
objRs.CursorLocation = adUseClient
' Open the recordset
pszString = "[" & frmActiveForm.txtTable.Text & "]"
objRs.Open pszString, objCn, adOpenStatic, adLockOptimistic
Debug.Print "Number of Records : "; objRs.RecordCount
Do While Not objRs.EOF
If Len(objRs.Fields("f3").Value & "") <> 0 Then
Debug.Print objRs.Fields("f3").Value
End If
objRs.MoveNext
Loop
Exit Function
function_error:
Debug.Print err.Description, err.Number
End Function
How To Search For Data In The Worksheet By Specific Cell Name
First of all, I'd like to apologize if I post this topic in wrong forum. I'm a newbie for VB and now I got one project which has to be implemented in VB.
In my project, I've to write the program to fill in the data in specific cell name in excel spreadsheet. But until now it doesn't work
For example, I've data in range A1:C10 which I've one cell named 'Address', not the value of that cell, which I'd like to fill data in. Firstly, I specified the range in the spreadsheet by using
Set rng = myWorksheet.Range("A1:C10")
then I wanna find where the cell named 'Address' is but I've no idea how to do it. Anybody has and idea? I tried with the command 'Find'
Set rngFound = rng.Find(xxxxxxx, ,yyyyyy , Excel.XlLookAt.xlPart, _
Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, _
False)
but I don't know which parameter I'd pass to this function. Could you pls help me finding out?
Thanks in advance
Change Back Color Of A Specific Cell In A Msflexgrid
In a msflexgrid, can I set a cell's back color similarly to the textmatrix property for text? I could use the cellbackcolor property but I want to do it without setting the row and col properties to those of that specific cell, i.e. without changing the current row and col values.
Conditional Formatting In Excel Based On Specific Cell Updates
Hello,
I am creating an excel spreadsheet to track work progress and am having difficulty in setting up some conditional formatting on a column.
I have a header column as below:
Owner Coded Reviewer Review Number Status
Now underneath each of the above column headers, the data entered in each of the cells has an effect on what happens in the status column.
The status column has the following formaul entered in each cell:
Code:
=IF(J4<>"",IF(K4>=1,IF(M4<>"",IF(N4<>"","Ready for Rework (Post Review)","Review in Progress"),"Ready for Review"),"Schedule in Progress"),"Not Started")
Now for each of the 5 states which the formula can set in the status column I want to associate a colour - different to each other.
To do this i have created the following VBA:
Code:
Sub UpdateStatusColumn2()
Dim s As String
For Each c In Worksheets("Sheet3").Range("O2:O909").Cells
s = c.Value
Select Case s
Case s = "Not Started"
c.Activate
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Case s = "Schedule in Progress"
c.Activate
With Selection.Interior
.ColorIndex = 38
.Pattern = xlSolid
End With
Case s = "Ready for Review"
c.Activate
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Case s = "Review in Progress"
c.Activate
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
End With
Case s = "Ready for Rework (Post Review)"
c.Activate
With Selection.Interior
.ColorIndex = 46
.Pattern = xlSolid
End With
Case s = "Closed"
c.Activate
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
End Select
Next
End Sub
My spreadsheet has almost 1000 rows and hence I do not want this to check every row when called.
What I want is for when the Owner, Coded, Reviewer, Review Number, or Status cells are updated for a particular row, then the above procedure UpdateStatusColumn2 is ran only on the same row for the cell in the Status column.
How do I do this? I know the for loop a the start will require updating as it will now no be required, but how do I get VBA to run the procedure only a single row when a cell underneath Owner, Coded, Reviewer, or Review Number is modified?
I should also say that I tried to use the Conditional Formatting within the Format menu but it only lets me use 3 conditions - which is not enough
I would appreciate all help offered.
Thanks,
W.
VB6, Entering Data Into MS Access DB, But Into A Specific Cell. Include Screenshots
Hi, my problem is that im making an application similar to a hotel management system(ive already seen source code of others on the net) but for a hospital.
Code:
If cmdOCCL1.Caption = "Occupy" Then
Set rs = Con.Execute("Insert into Ward1(RoomNo, FullName) " & _
"Values('" & 1 & "','" & txtPName1 & "')")
with this code its entering into the database table the room no which is 1 and the patients name from the txtbox.
But what i want to do is have the numbers already in the database say 1 - 20.
but the command button must add that name specifically into the row with room no. 1.
so i cant figure how to specifically add data to a specific row or cell type thing.
because say i do room 1 and the patients name goes next to room 1, then i do room 7 it will just stack one after another putting the patients name from room 7 next to room 2.
so names just stack or go in one after another.
so i'd like to figure how to put it in the specific cell or row and also how to have max room no's or rows kept at 20.
thx all help appreciated.
Find A Subfolder With A Specific Name
Hi guys,
I'm quite new to working with folders. What i wan't to do is straightforward. In my app a user can define a folder and a string. The folder defined is the folder where the application will look for subfolders with a name that corresponds to the string.
I read about using recursive looping but don't know exactly how to start. Can anyone push me in the correct direction...?
Thanks,
Crash
ADO Could Not Find The Specific Provider
i get the following error message:
ADO could not find the specific provider
when i use it in windows 98 or 2000 it works perfect but in win95 i get :
ADO could not find the specific provider
help please...
Find Location Of A Specific Exe
Thanks,
I didn't say the right thing in my question.
I know that DIR is going to be used, most likly. I have found code that uses arrays (don't have any experience with them), but they do not work, or I don't understand.
Can some point me in the right direction.
Thanks,
JazzBass
ADO - Find A Specific Record ??
Hi,
I'm creating a database application that uses a MS Access Database, I'm using ADO to open the connection and Recordset. If I have a Recordset Already Opened, What is the fastest or best best way to find a specific Record.
Example...
* If I wanted to search for a record the Matches these:
FirstName = Omar
AND
LastName = Swan
AND
Sex = Male
Thanks
Find And Delete Specific
I am trying to create a macro in excel that will find a specific keyword and then delete the row where the search is found and the subsequent four or rows underneath this find. How would I go about doing this? Any help would be great, thanks in advance.
Find A Specific Letter In A Word
I need to know if there is any sort of Visual Basic equivalent to the Javascript CharAt() function.
It's for a hangman game. I need to be able to get the length of the word too - that's another thing I can't do!
Thanks in advance...
How To Find A Specific Instance Of Excel From VB6?
I've written a dictator application in VBA which is launched from an .exe. How do I test all instances of Excel running to see which is my application? (I could, for example, set a tag on the Excel.Application but I don't know how to run through in the VB6 frontloader all running instances of Excel to find it.). Any ideas?
Find Specific Record In List Box
Hi,
How I can find specific record in List Box (sort ascending) that bound from source in textbox on the same form? It is easy when I type complete word (ex. computer ------> computer) .
BUT how I can find and set focus (select) row ex. computer (in List Box) if I type in text box only ex. com or compu
Thanx
How To Find A Specific Word In A Variable?
I need a simple way to do this..
(like the indexof(blah) in ASP / java)
if i have the variable "MSG this message"
how can i make it find the "MSG" part in that variable.
and if there is a "MSG" part in the variable, how can i make it read only what is behind the MSG part...
So that i can use this as a "command" in a text based program.
like if i write "MSG whatever text there is to write" into a variable (textbox) then it sees the MSG and takes the rest and produces
MSGBOX "whatever text there is to write",,"MSG command"
How can i do this? ?!?!?
Please provide whatever example you might have on this...
Thanks... in advance -AlexData-
Find Specific Item In Listbox
Hello,
Is there a way to discover whether a specific item is present in a listbox?
e.g. I have a listbox with four strings in it: "this", "is", "my", "test"
Suggest I want to know whether the string "my" is already in the listbox.
Any suggestions??
Thanks !
Find Specific Text In A File
I have 3000 files that i would like to get a specific text.
It is always at the second line of the files.
The textfiles are always something like this.
01,04,01,00012, 2005-07-25 11:40:08, 2005-07-25 21:02:00, 0
02,100,111,"2",112,"2",113,"60064","2005-07-25"
I would like to capure the text where i marked it as bold.
I would like to use this.
gmmastros helped me with for each and i like to continue using it.
CODEDim fso As FileSystemObject
Dim oFolder As Scripting.Folder
Dim oFile As Scripting.File
Dim strData As String
For Each oFile In oFolder.Files
strData = oFile.OpenAsTextStream(ForReading).ReadAll
Next
How Do I Do To Find A Specific Function In API Files?
Hi all!!
I need to change my vb project to activate the program (already resident in memory) by pressing a shortcut key. Is there someone to tell me how to do that or some piece of code about it?
Thanks in advance.
Find Files In A Specific Folder
I have a folder in the application path where are saved some text files. Now I want automatically with a sub procedure to find one by one these text files (sequentially) and present to a Rich textbox their content. So far I have tried to make this through the Filesystemobject but my attempt has failed. Here is a sample of my code:
Dim ObjFSO As New Scripting.FileSystemObject
If ObjFSO.FolderExists(PathAnnotationFiles) Then
Dim ObjFolder
Set ObjFolder = ObjFSO.GetFolder(PathAnnotationFiles)
Dim ObjFile
For Each ObjFile In ObjFolder.Files
Label1.Caption = ObjFile.GetFileName
Next
Opening Excel, Selecting Book / Sheet - Read/write Data To/from Specific Cell Usinf WIN 3A
Please can someone inform me how to do the following using Win32 API functionds onlyl;
1) open excel
2) open a named bookbook and select specific sheet
3) read or write an entry into or out of a specific cell;
I have opend other programs before from a VB6 environment using shell execute statement, however in this problem I am not using VB6, rather a prorietary programming language that allows me to have access to WIN 32 API functions - so my problem has to be solved using these functions only.
Any one's help on this probelm is greatly appreciated.
Regards
adam
Use Macro To Find A Specific Word In Excel
Hi all,
I need the help as currently i have created a vb program which link to excel worksheet. The program has to search for example "FREIGHT" word in EXCEL column B. If the column B has such "FREIGHT" wording, the program should stamp "FOUND" in column C else nothing will stamp in column c.
I can use below script to find the "FREIGHT", but my question is how to set "FOUND" in column C if the "FREIGHT" wording is found in column b? Anybody got any clue on it ?
ExcelSheet.Columns.Find(What:="FREIGHT", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
Please help!
Thanks!
From,
Siaw Ch'ng
TreeView Control - Find A Specific Node
Hi everybody, here's my quest:
i have been looking for a code that allow me to get a "given" node on a treeview control (like the IIS consolle with various WEB description, each description set a node).
I've got that i've to use API:
FindWindow and FindWindowEX
But i haven't a clue about how to achieve my goal.
My VB application:
text box
command button
User insert a WEB description in the TEXT BOX, then VB app open IIS consolle end search for the node which has the given description.
Thank's to all
Find And Select A Specific Row In DataGrid Control In VB6.
In code I need to find, select and highlight a specific row in a DataGrid control based on the value of a specific field (column) in the grid. Iterating through the rows using .Row is unacceptable because .Row only deals with visible rows and the row being sought may not be visible. Ideas?
Can Find Cell Value
I am using a VB macro to pull numbers from an excel spread sheet. My problem is when I use a command like:
Val = Cells(r, c).Value
'r(row),c(column), val(integer - the cell value is an integer)
It only works some of the time. The problem seems to come about when the owner of the Excel spread sheet clicks and drags values across cells instead of typing them out by hand. If I go back to the spread sheet and type in the cell value again, the call works. Otherwise the call returns zero. Am I doing something wrong??? I need a little help here. Thanks
Tim
FInd Value In Cell
I need to find a cell value. I also want it to search from the bottom up.
thnaxt to a tip by Timbo I came across this -which I modified to my own needs -well not mine literally, but to the specs and boundary parameters of my problem to solve.
Code:
Public Sub FindCell()
Found = False
flag = 0
Dim objExcel As ExCel.Application
Dim objXLS As ExCel.Sheets
Dim Rng As Range
Dim rgLast As Range
Dim c As Variant
Set objXLS = Nothing
Set objExcel = Nothing
Set objExcel = New ExCel.Application
objExcel.Visible = True
objExcel.Workbooks.Open FileName:="K:Persoonlijke WerkmappenJaimyVBSearchCert3.1b.XLS"
Set rgLast = Range("A1").SpecialCells(xlCellTypeLastCell)
Set Rng = Range("A1").Find(What:=Form1.Text1.Text, After:=rgLast.Row, LookIn:=xlValues, LookAt:=xlPrevious)
If Rng Is Nothing Then
MsgBox "Data not found"
Exit Sub
Else
MsgBox "Certificate Exists"
End If
MsgBox ("Search Ended")
End Sub
Gives a "type mismatch" error in
Code:
Set Rng = Range("A1").Find(What:=Form1.Text1.Text, After:=rgLast, LookIn:=xlValues, LookAt:=xlPrevious)
End Sub
But -uhm- it does'n't tell me which parameter mismatches what type
okay -it's in the rgLast.row bit -
I changed it to rgLast -since after is (if I interpret msdn correctly) a range:
Code:
Set Rng = Range("A1").Find(What:=Form1.Text1.Text, After:=rgLast, LookIn:=xlValues, LookAt:=xlPrevious)
End Sub
so (since rgLast is also a range) now I shouldn't have a typemismatch.
I still have one
PS does anybody know WHY you can't manually set a range (i.e. e.g. :
Code:
After:= (rgLast.row,1)
?
How To Find The Name Of A Cell
Can anyone help me in finding the name of a cell given the numeric address of a Cells(2,2)
If I specify Cells (2,2) then I should get "B2", otherwise I have to keep any array of size IV to have the mapping with number and alphabet.
Thanks In Advance
Deep
How To Find And Replace A Specific String In A Text File
Hi,
I have an app which read a CSV format text file an example is:
"Abc","123","Hello","27/08/2005"
Now when I read this file using the statement
VB Code:
Open c:Test.txt for Input as #fNum Do Until EOF(fNum)Input, #FNum, var1,var2,var3,var4loopClose #fNum
Now I want to check the value of var4 if it's current date then var3's value should be changed. Any ideas on this?
Thanks in advance
How To Find All The Files Of A Computer With An Specific Extension? *RESOLVED*
Hey guys! I have a code to find a specific file... Then I tryed to change it to find all the files with a specific extention, like ".htm"
But it seens not working... I already tryed "*.htm" and chr$(42) & ".htm"...
Here is my piece of code...
For driveexist = 0 To Drive1.ListCount
driveletter = Left$(Drive1.List(driveexist), 2)
file = FindFile(driveletter & "", "open.html") 'I am trying here to make it search from *.extension of the file
If file <> "" Then
Exit For
End If
Next
Anybody have ideas to solve it? =-)
thanks guys!
Elminster
|