Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am going nowhere quick searching for this, so hopefully someone can help me. I have a sheet with "x" number of rows of data. I would like to search the second column for a specific string. Each time the string is found, I need to paste the value of variable "var1" and "var2" into column Q and R of that row. I would also like to know how many times the string was found at paste value into the first column of that row. I'm sure I could use a For loop to do this, but the data sheet can be very long and I was wondering if there was a better way to do this with the ".find()" or ".advancedfilter()" functions. Thanks, Logan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm glad I saw your posting. I never thought of using the advancedfilter
function for something like this, but I think it could save time. I played arround with it and came up with this. I think if you tweek it, it should work. Selection.AutoFilter Field:=2, Criteria1:="FindThisString" Dim lngCount As Long lngCount = Range("B2", Range("B65536").End(xlUp)).SpecialCells(xlCellType Visible).Count 'lngCount will give you the totoal number of rows 'Do for only the visible cells For Each c In Range("B2", Range("B65536").End(xlUp)).SpecialCells(xlCellType Visible) c.Offset(0, 15) = "new value" c.Offset(0, 16) = "new value" Next " wrote: Hi, I am going nowhere quick searching for this, so hopefully someone can help me. I have a sheet with "x" number of rows of data. I would like to search the second column for a specific string. Each time the string is found, I need to paste the value of variable "var1" and "var2" into column Q and R of that row. I would also like to know how many times the string was found at paste value into the first column of that row. I'm sure I could use a For loop to do this, but the data sheet can be very long and I was wondering if there was a better way to do this with the ".find()" or ".advancedfilter()" functions. Thanks, Logan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data changes in advanced filter | Excel Worksheet Functions | |||
Advanced filter search | Links and Linking in Excel | |||
Using advanced filter to search for criteria in a list | Excel Discussion (Misc queries) | |||
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du | Excel Worksheet Functions | |||
Advanced Filter Copy Paste Blank Line Hell :( | Excel Programming |