ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Select multiple adjacent cells of multiple cells without selecting (https://www.excelbanter.com/excel-worksheet-functions/251441-select-multiple-adjacent-cells-multiple-cells-without-selecting.html)

sjsjsjsjsjs

Select multiple adjacent cells of multiple cells without selecting
 
Select multiple adjacent cells of multiple cells without selecting adjacent
cells one by one. those cells looks like;
|Column A1 |Column A2|
|random characters | A |
|sjsjsjsjskkskskskk | B |
|wtwuwuwuuusisis | A |
|wuuuuusiwuwuwiu| A |
|euuuuuuuuuuuuuuu| B |
I am trying to select A1 cells that's adjacent of A2 cells without selecting
A1
cells one by one.

Thank you for your help.

sjsjsjsjsjs

Select multiple adjacent cells of multiple cells without selecting
 
I am trying to select A1 cells that's adjacent of "B" cells without selecting
A1 cells one by one

I am trying to select A1 cells that's adjacent of A2 cells without selecting
A1 cells one by one.




Gord Dibben

Select multiple adjacent cells of multiple cells without selecting
 
You need to do a little research into Excel cell referencing with regard to
rows and columns.

A1 and A2 are cells in Column A, not separate columns.


Gord Dibben MS Excel MVP

On Fri, 18 Dec 2009 16:21:01 -0800, sjsjsjsjsjs
wrote:

Select multiple adjacent cells of multiple cells without selecting adjacent
cells one by one. those cells looks like;
|Column A1 |Column A2|
|random characters | A |
|sjsjsjsjskkskskskk | B |
|wtwuwuwuuusisis | A |
|wuuuuusiwuwuwiu| A |
|euuuuuuuuuuuuuuu| B |
I am trying to select A1 cells that's adjacent of A2 cells without selecting
A1
cells one by one.

Thank you for your help.



sjsjsjsjsjsjs

Select multiple adjacent cells of multiple cells without selec
 
those cells looks like;
|Column A |Column B|
|random characters | Y |
|sjsjsjsjskkskskskk | Z |
|wtwuwuwuuusisis | Y |
|wuuuuusiwuwuwiu| Y |
|euuuuuuuuuuuuuuu| Z |
..
..
..
..
continue...
I am trying to select A cells that's adjacent of Y cells without selecting A
cells one by one, then
copy selected cells to Column C, and
keep rows of selected cells.
those cells will look like;
|Column C |
|random characters |
| |
|wtwuwuwuuusisis |
|wuuuuusiwuwuwiu|
| |
..
..
..
..
continue...

Thank you for your help.

those cells looks like;
|Column A1 |Column A2|
|random characters | A |
|sjsjsjsjskkskskskk | B |
|wtwuwuwuuusisis | A |
|wuuuuusiwuwuwiu| A |
|euuuuuuuuuuuuuuu| B |
I am trying to select A1 cells that's adjacent of A2 cells without selecting
A1
cells one by one.





Rick Rothstein

Select multiple adjacent cells of multiple cells without selec
 
This macro should do what you want...

Sub MoveColAToColCFilterOnColB()
Dim X As Long, LastRow As Long, Answer As String
Answer = InputBox("What Column B character(s) do you want to filter on?")
If Len(Answer) 0 Then
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 1 To LastRow
If StrComp(Cells(X, "B").Value, Answer, vbTextCompare) = 0 Then
Cells(X, "B").Offset(, 1).Value = Cells(X, "B").Offset(, -1).Value
End If
Next
End If
End Sub

The code will ask you what text in Column B to search on and then perform
its copy operation.

--
Rick (MVP - Excel)


"sjsjsjsjsjsjs" wrote in message
...
those cells looks like;
|Column A |Column B|
|random characters | Y |
|sjsjsjsjskkskskskk | Z |
|wtwuwuwuuusisis | Y |
|wuuuuusiwuwuwiu| Y |
|euuuuuuuuuuuuuuu| Z |
.
.
.
.
continue...
I am trying to select A cells that's adjacent of Y cells without selecting
A
cells one by one, then
copy selected cells to Column C, and
keep rows of selected cells.
those cells will look like;
|Column C |
|random characters |
| |
|wtwuwuwuuusisis |
|wuuuuusiwuwuwiu|
| |
.
.
.
.
continue...

Thank you for your help.

those cells looks like;
|Column A1 |Column A2|
|random characters | A |
|sjsjsjsjskkskskskk | B |
|wtwuwuwuuusisis | A |
|wuuuuusiwuwuwiu| A |
|euuuuuuuuuuuuuuu| B |
I am trying to select A1 cells that's adjacent of A2 cells without
selecting
A1
cells one by one.






Rick Rothstein

Select multiple adjacent cells of multiple cells without selec
 
Another way you could approach this is to use formulas in your Column C
cells. Assuming you will want to "filter" on different text every now and
then, put the text string you want to look for in Column B in cell D1 (that
is, put the letter Y in D1) and put this formula in C1 and copy it down as
far as you like...

=IF(B1=$D$1,A1,"")

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
This macro should do what you want...

Sub MoveColAToColCFilterOnColB()
Dim X As Long, LastRow As Long, Answer As String
Answer = InputBox("What Column B character(s) do you want to filter on?")
If Len(Answer) 0 Then
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 1 To LastRow
If StrComp(Cells(X, "B").Value, Answer, vbTextCompare) = 0 Then
Cells(X, "B").Offset(, 1).Value = Cells(X, "B").Offset(, -1).Value
End If
Next
End If
End Sub

The code will ask you what text in Column B to search on and then perform
its copy operation.

--
Rick (MVP - Excel)


"sjsjsjsjsjsjs" wrote in message
...
those cells looks like;
|Column A |Column B|
|random characters | Y |
|sjsjsjsjskkskskskk | Z |
|wtwuwuwuuusisis | Y |
|wuuuuusiwuwuwiu| Y |
|euuuuuuuuuuuuuuu| Z |
.
.
.
.
continue...
I am trying to select A cells that's adjacent of Y cells without
selecting A
cells one by one, then
copy selected cells to Column C, and
keep rows of selected cells.
those cells will look like;
|Column C |
|random characters |
| |
|wtwuwuwuuusisis |
|wuuuuusiwuwuwiu|
| |
.
.
.
.
continue...

Thank you for your help.

those cells looks like;
|Column A1 |Column A2|
|random characters | A |
|sjsjsjsjskkskskskk | B |
|wtwuwuwuuusisis | A |
|wuuuuusiwuwuwiu| A |
|euuuuuuuuuuuuuuu| B |
I am trying to select A1 cells that's adjacent of A2 cells without
selecting
A1
cells one by one.







sjsjsjsjsjsjschanged

Select multiple adjacent cells of multiple cells without selec
 
Thank you for your help.
Macro really worked.
re you working for Microsoft or have ou ever worked for Microsoft?
Did Microsoft ever publis A Super Input Routine?
my search in microsoft websites doesn't show any of information about book.

Thank you for your help.

"Rick Rothstein" wrote:
"Rick Rothstein" wrote in message
...
This macro should do what you want...

Sub MoveColAToColCFilterOnColB()
Dim X As Long, LastRow As Long, Answer As String
Answer = InputBox("What Column B character(s) do you want to filter on?")
If Len(Answer) 0 Then
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 1 To LastRow
If StrComp(Cells(X, "B").Value, Answer, vbTextCompare) = 0 Then
Cells(X, "B").Offset(, 1).Value = Cells(X, "B").Offset(, -1).Value
End If
Next
End If
End Sub

The code will ask you what text in Column B to search on and then perform
its copy operation.


Rick Rothstein

Select multiple adjacent cells of multiple cells without selec
 
This is the problem with having your topic split... I just responded to this
message over in the other newsgroup.

--
Rick (MVP - Excel)


"sjsjsjsjsjsjschanged"
wrote in message ...
Thank you for your help.
Macro really worked.
re you working for Microsoft or have ou ever worked for Microsoft?
Did Microsoft ever publis A Super Input Routine?
my search in microsoft websites doesn't show any of information about
book.

Thank you for your help.

"Rick Rothstein" wrote:
"Rick Rothstein" wrote in message
...
This macro should do what you want...

Sub MoveColAToColCFilterOnColB()
Dim X As Long, LastRow As Long, Answer As String
Answer = InputBox("What Column B character(s) do you want to filter
on?")
If Len(Answer) 0 Then
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 1 To LastRow
If StrComp(Cells(X, "B").Value, Answer, vbTextCompare) = 0 Then
Cells(X, "B").Offset(, 1).Value = Cells(X,
"B").Offset(, -1).Value
End If
Next
End If
End Sub

The code will ask you what text in Column B to search on and then
perform
its copy operation.




All times are GMT +1. The time now is 11:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com