How to delete formula from cells and keep the values in Excel VBA

Hi,
In my Excel I have 15 columns. In column F which has a formula (INDEX MATCH), it has contains "RECEIVED" and "INTRANSIT". I need to filter the column F for all "RECEIVED" and then remove the formula from cells and
retain or keep the values that are already in the cells. something tricky and i'm not sure on how to work on this in Excel VBA.
Below is my initla VBA code:
I already have the codes on how to filter. kindly please help me on how to do this. thank you in advance.
Sub test_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long
Set wb = ThisWorkbook
Set ws = wb.Sheets("Intransit_")
Application.ScreenUpdating = False
ws.AutoFilterMode = False
With ws
lrow = .Range("F" & Rows.Count).End(xlUp).Row
Set rng = .Range("A1:R" & lrow)
Debug.Print rng.Address
rng.AutoFilter Field:=6, Criteria1:="RECEIVED"
End With
Application.creenUpdting = True
End Sub

Solved.
Sub test_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long
Dim rRec As Range
Dim btField As Byte
Set wb = ThisWorkbook
Set ws = wb.Sheets("Intransit_")
btField = 6
Application.ScreenUpdating = False
ws.AutoFilterMode = False
With ws
lrow = .Range("F" & Rows.Count).End(xlUp).Row
Set rng = .Range("A1:R" & lrow)
With rng
.AutoFilter Field:=btField, Criteria1:="RECEIVED"
On Error Resume Next
Set rRec = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
End With
.AutoFilterMode = False
If Not rRec Is Nothing Then
With rRec
.Columns(btField).Value = .Columns(6).Value
End With
End If
End With
Application.ScreenUpdating = True
End Sub

Similar Messages

  • I transferred pictures over from my computer to my iPhone 5 and now i cannot delete them on the phone and cannot work out how to delete them from my phone by the computer?

    I trasferred pictures over from my computer to my iPhone 5 and now i cannot delete these pictures from my phone, and i cannot work out how to delete them from my phone by the computer as the pictures do not show up in my files on the computer, how can i remove them i have over 400 pictures that need removing?

    If you have a Mac with iPhoto, plug the iPhone in and open iPhoto. Choose to import the photos. Once they have been imported, there should be an option to "Remove Imported Photos from Device". Choose this.

  • Can I delete a later backup and keep the latest one as to not eat up all my space?

    Can I delete a later backup and keep the latest one as to not eat up all my space?

    Are you talking about Time Machine backups on a Time Capsule?
    It is fine to delete the backup as long as you are sure there is nothing you want.. and do a new clean backup. That will be the least possible space usage for a working backup.. Never delete files out of an existing backup.. it is very hard to manually delete files in the backup.
    We do not recommend it.

  • How to delete ios 5.1 and install the older version

    how to delete ios 5.1 and install the older version????

    apple stopped signing 5.0.1 and 5.0 fw.
    but to answer your question, you can still download old firmwares and then press shift while clicking on the restore button in itunes, point it to the fw and there you (should) go.

  • Call  RFC from ECC and display the values in  AET

    Hi ALL,
    I had an RFC in ECC ( Z_CRM_SPEC_DATA) this should be called into my AET Fields in getter method.
    In getter method of tat AET field what code should i write?
    Plz help me on this.

    HI,
    1) Call the  RFC(Z_CRM_SPEC_DATA) from ECC and display the values as mentioned in below AET fields.
    AET FIELDS :    zzfld00000M    zzfld00000N
    Description  :    Budget Quan    Forecast Quan
    values         :    (--5.0)(6.0--
    2) (Fetch Budget and Forecast data from ECC ),you would need to pass Material Number(MATNR) as well as Ship to party info to fetch the budget and forecast data as one material may be assigned to 2 or more SH with specific budget and forecast data for each.
    Edited by: venkatabharathv on May 23, 2011 2:44 PM
    Edited by: venkatabharathv on May 23, 2011 2:49 PM

  • How do I export a file and keep the aspect ratio intact?

    I'm exporting an edited scene from an external hard drive to a macbook but the video on the laptop is anamorphic (squished) compared to the original file on the hard drive.  How do I export the file and keep the aspect ratio intact?

    Please give the exact specs of your project. If the material is anamorphic, aspect ratio display is a function of the playback device. What is it?

  • How do delete photos from iPhone but keep them on the cloud?

    Is it possible to delete photos from an iPhone but keep them on the cloud? If not what is the purpose of buying extra storage for icloud If you phone can only hold up to 128gb?
    finding it hard to get a straight answer on this, so maybe have to go to a local shop and find out.

    Refer to this Faq.
    How does iCloud Photo Library save space on my device?
    iCloud Photo Library can move the original high-resolution photos and videos to iCloud and
    replace them with lightweight, device-optimized versions on your iOS device. This helps you
    make the most of your device storage while giving you access to more photos than ever.
    You can turn on Optimize [device] Storage from Settings > iCloud > Photos or Settings >
    Photos & Camera > iCloud Photo Library on your iPhone, iPad, or iPod touch. You will need
    an Internet connection to access an original photo or video that’s stored only in iCloud.
    Yes I want to know the answer too.
    If I subscribe to iCloud storage but my iPhone can just hold up to 16 gb.
    Why do I have to do it ? to make my iPad see photos from my iPhone?
    I did try to disable icloud photo while i had 1gb photos stored in my iPhone
    and wipe them out, yes ,nothing left, 0 data. but when I turn on iCloud Photo -
    again. everything come back as preview photos but when I look at each, my phone
    will download them all anyway. so, how can you manage space on devices actually?
    if I have 16 gb on my phone , So I can see all of my 1tb photos on iCloud ?
    and have enough space on the phone to do other things right?

  • How to delete contacts from iPhone and update changes to PC after synch?

    I spend a lot of time deleting old/unwanted/duplicated contacts on iPhone. Then I synch with PC through iTunes and I get two options: 1. MERGE or 2. Replace contacts on iPhone with PC information. If I click MERGE then all those contacts I deleted come back to my iPhone. MERGE seems to be a merely 'collapse' information feature...whether is from PC to iPhone or viceversa.
    Obviously I don't want to replace my iPhone contacts with those in PC, because then I will loose all those pictures I took to my contacts...also, all the time spent assigning pictures to contacts will go to trash can.
    This is kind of irritating...am I the only one having this problem? Active Synch for SmartPhones or Pocket PC nailed this down beautifully (it knows where the latest/most updated information happened and keeps that one).
    Help please.
    Message was edited by: apac

    Thank you for trying to help.
    I don't want to replace the information on my iPhone because in my iPhone where i have the most updated information (pictures assigned to contacts and deleted duplicated/unwanted contacts)...I would like to replace the contacts on my PC instead.
    After doing what you are suggesting will I be able to replace information on my PC? Is this what you mean?
    Thank you.

  • How to delete users from Dev and Testing once it is deleted in Production

    Sap Gurus,
    Is there any automated way to delete the users from development and testing once it is has been deleted from production. i.e. when the administrator deletes the user from production after logging in then it should automatically delete the users from testing and development without logging on in these 2 systems (development and testing). Can anyone help me in resolving this issue.
    I am very much thankful in advance..
    Regards,
    Kali

    Rob,
    Ok, you are right in that way I can allow only that person but I have to allow 2 persons at this time. i.e. If at all I have to allow one more person also how should I do it, and also what if the person uses different passwords in development and testing?
    Thanks for your response Rob.
    Kali.

  • How to delete photos from iPhoto and hard drive at the same time.

    I need to remove some files from my iMac G5 in order to free up some space. I have some photos on my machine that I would like to delete. Is there a setting I can change so that I completely remove a photo from my machine when I delete the iPhoto thumbnail? If not, what is the best way to remove photos from my machine, and not leave thumbnails in iPhoto to photos that no longer exist on my machine etc. I'm using iLife 08 and the most recent version of Leopard on a third generation iMac G5.

    To remove file from iPhoto and the HD simply put the files in the iPhoto trash and then go iPhoto Menu -> Empty trash.
    This works if you're using iPhoto in the default setting, where the files are copied to the Library on import. If, however, you have a referenced library, you'll need to trash the files in your own folder structure yourself.
    Regards
    TD

  • How do I move an event and keep the favorite clip selections?

    Hi all,
    I have to move several events from one external hard drive to another.  On many of these events I've already started selecting favorite clips.  When I moved my first event it erased my favorite selections.  Not good.  That took a lot of time and work.  How do I move events and save the favorite clip selections within each event? 
    Thanks,
    ggbeamer

    It would be a good idea to learn iPhoto - the iPhoto '09 tutorials will help - and it would be a worthwhile investment of time to take the iphoto tutorials - http://www.apple.com/findouthow/photos/ - they are very helpful and will save you a lot of time and frustration. and there are iPhoto '11 tutorials under the help menu
    A small investment of time now will save a lot of time and lost photos later
    LN

  • How to get Data from SAP B1 through Journal Entries objects (Excel VBA)

    Hi Genius
    i had try to login SAB B1 thorugh MS Excel VBA code and it worked well. but i need some questions regards getting the data from after login. that means i want the Posting date, Transaction No, account code, debit and credit amount from Journal entries posted in a particular day through MS excel VBA into excel sheets 1 cell A1:E1
    how i get it if any possible ways to do that
    here my code to login
    Public Sub login()
        Sheets("Login").Select  'access the login tab
        Worksheets("Login").Range("B1").Activate 'put focus on cell B1 (manager)
        B1UserID = Trim(ActiveCell.Value2) 'set Businsss One user
        ActiveCell.Offset(1, 0).Activate
        B1Password = Trim(ActiveCell.Value2) 'set Business One password
        ActiveCell.Offset(1, 0).Activate
        sqluser = Trim(ActiveCell.Value2) 'set SQL user
        ActiveCell.Offset(1, 0).Activate
        sqlpass = Trim(ActiveCell.Value2) 'set SQL password
        ActiveCell.Offset(1, 0).Activate
        Db = Trim(ActiveCell.Value2)      'set Database name
        ActiveCell.Offset(1, 0).Activate
        Server = Trim(ActiveCell.Value2)  'set Server name
        Set company1 = New SAPbobsCOM.Company  'initialate DI company object
        company1.DbServerType = dst_MSSQL2005
        company1.Server = Server
        company1.DbUserName = sqluser
        company1.DbPassword = sqlpass
        company1.CompanyDB = Db
        company1.UserName = B1UserID
        company1.Password = B1Password
        'connect to the database
         lRetCode = company1.Connect
            If lRetCode <> 0 Then
                sErrMsg = company1.GetLastErrorDescription
                MsgBox (sErrMsg)
            Else
                MsgBox ("Connected to: " & company1.CompanyName)
            End If
    End Sub
    pls help me
    advance thanks to solvers

    Gordons way is the easiest - just query the OJDT table for journal entry headers and JDT1 for journal entry lines if needed.
    But if you want to work with the business objects:
    'Journal entry
       Dim oJE As SAPbobsCOM.JournalEntries
       Set oJE = company1.GetBusinessObject(oJournalEntries)
       oJE.GetByKey(1234)
       Dim postingDate as String
       postingDate = oJE.DueDate
    'etc etc

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to delete photos on device and keep them on iCloud?

    I have 1T iCloud storage so I can keep my 500G photos library on the cloud. But how am I supposed to keep all those photos accessible to my devices if my iPad or iPhone only go up to 128G? If I delete a photo on these devices, it gets deleted on the cloud. So what's the point of having big storage access to all your photos? I'm limited by my devices storage! Am I getting something wrong?
    Thanks.

    Seep Ipod 101:
    http://docs.info.apple.com/article.html?artnum=304708#3
    To set manual, plug in your iPod and right click on it. Select Ipod Options.
    Check - manually manage songs and playlists.
    Note you have to eject your ipod manually from iTunes before unplugging it.

  • How to export a PDF from InDesign and keep the feature button ?

    I have an InDesign file with buttons and "Go to Page" features. So, the buttons are for navigate in the document.
    But when I exported my files in Interactive PDF, the "roll over" effect work, but buttons don't work....
    How to save my PDF file for the buttons work?

    Interactive PDF work with: Go to next view and Go to previous view. But you can do this with hyperlink>link to: page

Maybe you are looking for