Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Identify Last Cell and autofill last column

Hi,
I have a spreadsheet for which I need to identify the last cell with data
[nos. or formula] and on the column to the right I need to autofill with row
nos. Row numbering should stop when the row with the last cell is reached. Eg
if data is to row 672 only then the row number should be "numbered" as 672.

Thanks,

Manir
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Identify Last Cell and autofill last column

On Sep 21, 9:00 am, manfareed
wrote:
Hi,
I have a spreadsheet for which I need to identify the last cell with data
[nos. or formula] and on the column to the right I need to autofill with row
nos. Row numbering should stop when the row with the last cell is reached. Eg
if data is to row 672 only then the row number should be "numbered" as 672.

Thanks,

Manir


Hello Manir,

Not sure if this what you are looking. This code example finds the
last row in column "A" and then fills each cell in column "B" with the
row number.

Dim LastRow As Long
Dim R As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Cells(R, "B").Value = R
Next R

Sincerely,
Leith Ross


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Identify Last Cell and autofill last column

Hi,

Thanks for your solution to my question.

What if you don't know what the last column is ?

Thanks,

Manir

"Leith Ross" wrote:

On Sep 21, 9:00 am, manfareed
wrote:
Hi,
I have a spreadsheet for which I need to identify the last cell with data
[nos. or formula] and on the column to the right I need to autofill with row
nos. Row numbering should stop when the row with the last cell is reached. Eg
if data is to row 672 only then the row number should be "numbered" as 672.

Thanks,

Manir


Hello Manir,

Not sure if this what you are looking. This code example finds the
last row in column "A" and then fills each cell in column "B" with the
row number.

Dim LastRow As Long
Dim R As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Cells(R, "B").Value = R
Next R

Sincerely,
Leith Ross



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Identify Last Cell and autofill last column

Hello Leith,

Thanks for the code. It works !!!

What if I don't know what the last column is ? How would I amend your code ?

Thanks,

Manir

"Leith Ross" wrote:

On Sep 21, 9:00 am, manfareed
wrote:
Hi,
I have a spreadsheet for which I need to identify the last cell with data
[nos. or formula] and on the column to the right I need to autofill with row
nos. Row numbering should stop when the row with the last cell is reached. Eg
if data is to row 672 only then the row number should be "numbered" as 672.

Thanks,

Manir


Hello Manir,

Not sure if this what you are looking. This code example finds the
last row in column "A" and then fills each cell in column "B" with the
row number.

Dim LastRow As Long
Dim R As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Cells(R, "B").Value = R
Next R

Sincerely,
Leith Ross



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Identify Last Cell and autofill last column

On Sep 23, 12:56 pm, manfareed
wrote:
Hello Leith,

Thanks for the code. It works !!!

What if I don't know what the last column is ? How would I amend your code ?

Thanks,

Manir



"Leith Ross" wrote:
On Sep 21, 9:00 am, manfareed
wrote:
Hi,
I have a spreadsheet for which I need to identify the last cell with data
[nos. or formula] and on the column to the right I need to autofill with row
nos. Row numbering should stop when the row with the last cell is reached. Eg
if data is to row 672 only then the row number should be "numbered" as 672.


Thanks,


Manir


Hello Manir,


Not sure if this what you are looking. This code example finds the
last row in column "A" and then fills each cell in column "B" with the
row number.


Dim LastRow As Long
Dim R As Long


LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Cells(R, "B").Value = R
Next R


Sincerely,
Leith Ross- Hide quoted text -


- Show quoted text -


On a similar note.
If I wanted to identify the last row and then add formulas in each of
some 32 fields/columns for the next 1 row would we do something
similar?

I have a Data sheet.
I have a Calc sheet that references the Data sheet using NamedRanges
which return the same row.
I'm trying to eliminate 1000's of If Then formulas that reference a
data sheet for it's calculations. The data sheet uses 32 RangeNamed
columns and holds client data as necessary. I currently copy such
formulas in the Calc sheet down 5,000 rows since I don't know how many
rows a client will use in the Data sheet. This makes the workbook
appear larger than it actually is but works fine unless the client
exceeds 5000 records in the Data sheet.

Dennis

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
Autofill column from data (code) in column next to it Matt Excel Worksheet Functions 4 April 24th 09 06:17 PM
Automating to autofill column B based on column A entry GirlFridayCA Excel Discussion (Misc queries) 2 December 2nd 08 10:46 PM
autoFill column equal to adjacent column Paulg[_4_] Excel Programming 4 July 17th 06 01:04 PM
Identify Cell by Column Header and ID in Col A (Track Changes) Bettergains Excel Programming 1 April 4th 05 01:33 PM
Use one column to identify values in adjacent column. Ken Fickling Excel Programming 1 July 8th 03 09:26 PM


All times are GMT +1. The time now is 02:25 AM.

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"