我如何...搜索从列中输入的值的范围并将其复制到不同的工作表 [英] How do I...search range of values taking input from a column and copy it to different sheet

查看:98
本文介绍了我如何...搜索从列中输入的值的范围并将其复制到不同的工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一些记录需要在excel的A列中搜索,如果这些记录存在于A列中,那么整行需要复制到excel的sheet2。到目前为止,我已经尝试过了。这是为了一次输入一个输入。但我想将输入多个值作为一系列值。怎么做..



Hello,
I have some records which needs to be searched in column A of an excel and if those are present in column A then the whole row needs to be copied to sheet2 of excel. So far I have tried this . This is for taking one input at a time . But I want to take input multiple values as a range of values. How to do this ..

Dim strsearch As String, lastline As Integer, tocopy As Integer

strsearch = CStr(InputBox("enter the string to search for"))
lastline = Range("A65536").End(xlUp).Row
j = 1

For i = 1 To lastline
    For Each c In Range("A" & i & ":Z" & i)
        If InStr(c.Text, strsearch) Then
            tocopy = 1
        End If
    Next c
    If tocopy = 1 Then
        Rows(i).Copy Destination:=Sheets(2).Rows(j)
        j = j + 1
    End If
tocopy = 0
Next i







如何一次搜索多个值。请帮助




how to search for multiples values at a time . please help

推荐答案

这篇关于我如何...搜索从列中输入的值的范围并将其复制到不同的工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆