Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Resize offset

I'm using a statement like the following to fill some columns (minus
the header, row 1) with formulas or functions.

With ThisWorkbook.Sheets("sheet1").Cells(1, 1).CurrentRegion.Offset(1,
0)
.Columns(25).FormulaR1C1 = "=someformula"
end with

How can I use resize to avoid creating an additional used row at the
bottom? I've been fooling with it for a bit now, and I clearly am not
understanding it completely. The code works fine as is, but then I
have to go get rid of the extra row(s) afterwards.

Thanks!
Ward376

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Resize offset

I'd use something like:

Dim myRng as range
with ThisWorkbook.Sheets("sheet1").Cells(1, 1).CurrentRegion
set myrng = .resize(.rows.count-1,1).offset(0,24) 'same as 25th column
end with
myrng.formular1c1 = "=someformulainr1c1reference style"



ward376 wrote:

I'm using a statement like the following to fill some columns (minus
the header, row 1) with formulas or functions.

With ThisWorkbook.Sheets("sheet1").Cells(1, 1).CurrentRegion.Offset(1,
0)
.Columns(25).FormulaR1C1 = "=someformula"
end with

How can I use resize to avoid creating an additional used row at the
bottom? I've been fooling with it for a bit now, and I clearly am not
understanding it completely. The code works fine as is, but then I
have to go get rid of the extra row(s) afterwards.

Thanks!
Ward376


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Resize offset

How about if I want to use the first column?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Resize offset

Can I set this range in one line?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Resize offset

I keep getting an object/application-defined error at the Set line.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Resize offset

Show the code

"ward376" wrote:

I keep getting an object/application-defined error at the Set line.


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
Set new range based on rng.Offset(rng.Rows.Count, 0).Resize(1, 1) Keith Excel Programming 2 January 7th 07 08:35 PM
Why Copy/Paste fails using Offset & Resize of myRange? [email protected] Excel Discussion (Misc queries) 3 November 21st 06 02:06 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
using .resize or an offset cereldine[_12_] Excel Programming 2 April 10th 06 05:51 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM


All times are GMT +1. The time now is 04:02 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"