Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Find Last Row + 1

I have used the following code to put the formula in a specific column all
the way to the last cell. It is working good, except it misses the last row.
Is there a way to force it to go one row extra. Any help will be
apprecaited. Thanks!


Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Find Last Row + 1

Set r = ActiveSheet.UsedRange

nLastRow = r.Rows.Count + r.Row - 1
yields the last row
nOneStepBeyond = r.Rows.Count + r.Row
the next row
--
Gary's Student


"Jasmine" wrote:

I have used the following code to put the formula in a specific column all
the way to the last cell. It is working good, except it misses the last row.
Is there a way to force it to go one row extra. Any help will be
apprecaited. Thanks!


Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Find Last Row + 1

Use an offset kinda like this...

Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count,
5).End(xlUp).offset(1,0))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"
--
HTH...

Jim Thomlinson


"Jasmine" wrote:

I have used the following code to put the formula in a specific column all
the way to the last cell. It is working good, except it misses the last row.
Is there a way to force it to go one row extra. Any help will be
apprecaited. Thanks!


Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Find Last Row + 1

I think that will offset the entire range, not just add one more row to it...
I think the offset needs to be inside the final bracket...
--
HTH...

Jim Thomlinson


"Ardus Petus" wrote:

Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count,
5).End(xlUp)).offset(1,0)


HTH
--
AP

"Jasmine" a écrit dans le message de
news: ...
I have used the following code to put the formula in a specific column all
the way to the last cell. It is working good, except it misses the last
row.
Is there a way to force it to go one row extra. Any help will be
apprecaited. Thanks!


Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Find Last Row + 1

It looks like you should be using another column besides E to get that last
row???

Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
with rng
.resize(.rows.count+1).Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"
end with

Is one more way.

Jasmine wrote:

I have used the following code to put the formula in a specific column all
the way to the last cell. It is working good, except it misses the last row.
Is there a way to force it to go one row extra. Any help will be
apprecaited. Thanks!

Dim rng As Range
With Worksheets("CIP Exceptions")
Set rng = .Range(.Cells(5, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
rng.Offset(0, 1).Formula = "=TEXT(E5,""mmmm"")"


--

Dave Peterson
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
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 05:47 PM.

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

About Us

"It's about Microsoft Excel"