Problem with Find Code

charllie

Well-known Member
Joined
Apr 6, 2005
Messages
971
Hi Folks,

I have tried to adapt this code below to do the follow but cant seem to get it to work.

What i want it to do is to match the text in Me.IFPI.Box with the same text in column A of Sheets("Current Codes").

Then once it has located the row i want it to then replace the information in the colums with the infor from the textboxes (as indicated below).

However the code doesn't seem to be working. I would really appreciate it if someone could tell me where i am going wrong please?



Code:
   With Sheets("Current Codes")       '<- change here
        Set r = .Columns("a").Find(Me.IFPIBox.Text)
        If Not r Is Nothing Then
            With .Cells(r.Row, Columns.Count)
                .Offset(, 1).Value = Me.IFPIBox.Text
                .Offset(, 2).Value = Me.PressBox.Text
                .Offset(, 3).Value = Me.LayerBox.Text
                .Offset(, 4).Value = Me.LocationBox.Text
                .Offset(, 5).Value = Me.DateTextBox.Text
                .Offset(, 6).Value = Format(Date, "dd mmmm yyyy")
            End With
        End If
    End With
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

lozzablake

Well-known Member
Joined
Dec 15, 2005
Messages
818
r is defined as a range?

should it be range("a:a") rather than columns("a")?
 

Watch MrExcel Video

Forum statistics

Threads
1,108,624
Messages
5,523,967
Members
409,547
Latest member
AW2020

This Week's Hot Topics

Top