View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Find first value in row + add following values (Please, Urgent

You are very welcome
--
Gary's Student


"Evgeny" wrote:

Thanks a lot!

It works great!


Evgeny

"Gary''s Student" wrote:

You need a macro. Enter this:

Sub Macro1()
For i = 1 To 10
Cells(i, 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Resize(1, Selection.Columns.Count - 1).Select
If Selection.Count < 255 Then
Selection.Delete Shift:=xlToLeft
End If
Next
End Sub


As coded it works on the first 10 rows. You can modify the FOR loop to
cover any rows you wish.
--
Gary''s Student


"Evgeny" wrote:

Thanks, Gary

But I have 756 rows and 150 columns. I cannot do it manually every time. The
data is inputted from other sheets and I need the values to be organized in
first 18 columns for a report.
So, I need the values from rows to be shifted left, one after another,
dynamically (I will just paste values in, let's say, column GY, and if this
is the first value, it needs to be in column A, if it's 2nd value in row - it
goes to column B)


I appreciate your help,

Evgeny

"Gary''s Student" wrote:

Select the first cell in the row. While hold down the shift key, touch
end,right-arrow,left arrow and then release the shift key.


The pull-down:
Edit Delete... Shift cells left
--
Gary's Student


"Evgeny" wrote:

Hello,

I wonder if there is an easy way to find the first value in a row and put it
in column 1, the second value in that row will go to column 2, etc.
Example:
A B C D E... K L M N O P Q R S T V etc

3 5 2 4 8 3 5 2 4 8
5 4 8
5 4 8
6 8 2 1 9 6 8 2 1 9

Thank you very much,


Evgeny