Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to a cell based on cell above. 2

Status
Not open for further replies.

Spyder1000

Technical User
Nov 2, 2004
109
US
I've got a text file that I import into Excel. The fields in the file are in black.

I need to write the ID next to each of the records in a series. This is indicated in red.

1401655d.jpg

Any ideas would be greatly appreciated.
 

I have no idea what you are referring to relative to the title of your thread.

Please post some representative data and what you expect to do with it.

Skip,
[sub]
[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue][/sub]
 
Just put in a new column for ID's. Assume that your current Logon ID column is B and your new column is A and your formula would look something like this:

=if(B2="",A1,B2)

Hope that helps.

Kevin
 
I apologize for the poor title for this thread but unfortunately my problem is far more complicated than could be explained in a single line.

Here is my situation:
I have a text file that is exported from an IEX system. It looks like my attached picture. The black text is the fields in the report. The red text is the text I need to add.

The Why:
I import this file in to a database. In order to do this I need to be sure that each record in the 5th, 6th, and 7th columns have an ID associated with it. Since the IEX report only puts an ID for the first row in a group of records I have to come up with a way to write the ID to the rest of the records in that group. Hence the red text.

GoDawgs,
I currently use a formula exactly like the one you suggested. The problem is that This report runs for roughly 600 employees each of which have around 3 to 9 rows of data. Even though it’s a simple drag and drop for me the employee that will be using this solution lacks basic Excel skills which is why I’m trying to come up with a VBA Macro that could pull this off programmatically.

1401655d.jpg
 
The code would be the same idea...you'd start at row 1 and loop through to the end of the rows of data in your ID column...and for each cell along the way check if it's blank put in the data from the cell above, otherwise leave it alone.
 
Select the column in question from the first entry in that column to the last. If no blanks between first entry and top of sheet then just select entire column.

Then do edit / go to / special / blanks. Now type = and then hit the UP arrow once and then hit CTRL+ENTER at the same time. This will fill in all the records as necesaary, and then just copy the column and paste special as values.

Regards
Ken.............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top