Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not sure if I need a formula or some code....

Hello all.

I have a worksheet with 70 columns of data. I need to look bac
through all columns in each row (I will need the formula in each cel
of the last row), find the first blank cell, and copy the data from th
cell in the same row but 2 columns before the blank cell.

eg. Cell T34 is blank, I want the value (text) from cell R34 copie
into cell CD 34.

I hope I've explained enough.

Thanks in advance..

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not sure if I need a formula or some code....

Here's a code solution:

Code
-------------------
Sub test()

Dim iFirstRow As Long
Dim iLastRow As Long
Dim iFirstCol As Integer
Dim iLastCol As Integer

Dim i As Long
Dim j As Long

iFirstRow = 1 'Change to your first data row
iLastRow = Range("A65536").End(xlUp).Row
iFirstCol = 1 'Change to your first data column
iLastCol = 70 'Change to your last data column

For i = iFirstRow To iLastRow
For j = iFirstCol To iLastCol
If Cells(i, j).Value = "" Then
Cells(i, 82).Value = Cells(i, j - 2)
Exit For
End If
Next
Next

End Su
-------------------



--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Not sure if I need a formula or some code....

Hi
enter the following array formula (entered with CTRL+SHIFT+ENTER) in
CD34
=INDEX(A34:CC34,1,MIN(IF(A34:CC34="",COLUMN(A34:CC 34)))-2)

--
Regards
Frank Kabel
Frankfurt, Germany


Hello all.

I have a worksheet with 70 columns of data. I need to look back
through all columns in each row (I will need the formula in each cell
of the last row), find the first blank cell, and copy the data from
the cell in the same row but 2 columns before the blank cell.

eg. Cell T34 is blank, I want the value (text) from cell R34 copied
into cell CD 34.

I hope I've explained enough.

Thanks in advance...


---
Message posted from http://www.ExcelForum.com/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not sure if I need a formula or some code....

Thank you, I'll try it

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Not sure if I need a formula or some code....

Candee,

In CD34, Array enter, using Ctrl-Shift-Enter

=INDEX(34:34,1,MIN(IF(A34:CC34="",COLUMN(A34:CC34) ,256))-2)

Copy up and down the column as needed.

HTH,
Bernie
MS Excel MVP

"Candee " wrote in message
...
Hello all.

I have a worksheet with 70 columns of data. I need to look back
through all columns in each row (I will need the formula in each cell
of the last row), find the first blank cell, and copy the data from the
cell in the same row but 2 columns before the blank cell.

eg. Cell T34 is blank, I want the value (text) from cell R34 copied
into cell CD 34.

I hope I've explained enough.

Thanks in advance...


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not sure if I need a formula or some code....

Thank you both for your quick replies. I couldn't get the code to work
but the formula works like a charm - just what I was after.

Thank you again :

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula code nobbyknownowt Excel Discussion (Misc queries) 5 August 10th 06 05:40 PM
formula or code Monty Excel Worksheet Functions 10 January 10th 05 09:06 AM
Help with code or formula Gareth[_3_] Excel Programming 8 October 18th 03 12:43 AM
Formula or code Jim[_15_] Excel Programming 0 July 9th 03 05:51 PM
Formula or code John Gittins Excel Programming 0 July 9th 03 04:16 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"