Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default having problem with resize

Having problem with the following formula.

Sub CopyRow()
Dim lRows As Long

With Range("Database")
lRows = .Rows.Count + 1
Range("Input").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "Database"
End With

Application.Goto Reference:="level"

If Range("position").Value = "Player" And
Range("level").Value = "MIDGET" Then


With Range("MIDGET")
lRows = .Rows.Count + 1
Range("name").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "MIDGET"
End With

ElseIf Range("position").Value = "Pitcher" And
Range("level").Value = "MIDGET" Then


With Range("MIDGETPITCHER")
lRows = .Rows.Count + 1
Range("name").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "MIDGETPITCHER"
End With

The problem is with resizing "MIDGETPITCHER"(B3:P3). The
macro runs fine but I want it to place the "name" of the
player in B3 of named range "MIDGETPITCHER".
As it runs now all I get added each time is the column 'B'
added. I would like B:P added to each new player added.

any ideas what I'm doing wrong?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default having problem with resize

Not tested, but perhaps the pasting is messing up the range. Have you tried
expanding the range first and then pasting? Or pasting just the values using
PasteSpecial?

--

Vasant


"Logan" wrote in message
...
Having problem with the following formula.

Sub CopyRow()
Dim lRows As Long

With Range("Database")
lRows = .Rows.Count + 1
Range("Input").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "Database"
End With

Application.Goto Reference:="level"

If Range("position").Value = "Player" And
Range("level").Value = "MIDGET" Then


With Range("MIDGET")
lRows = .Rows.Count + 1
Range("name").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "MIDGET"
End With

ElseIf Range("position").Value = "Pitcher" And
Range("level").Value = "MIDGET" Then


With Range("MIDGETPITCHER")
lRows = .Rows.Count + 1
Range("name").Copy Destination:=.Cells(lRows, 1)
.Resize(lRows).Name = "MIDGETPITCHER"
End With

The problem is with resizing "MIDGETPITCHER"(B3:P3). The
macro runs fine but I want it to place the "name" of the
player in B3 of named range "MIDGETPITCHER".
As it runs now all I get added each time is the column 'B'
added. I would like B:P added to each new player added.

any ideas what I'm doing wrong?



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
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
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
problem with resize property Michelle Excel Programming 4 February 23rd 04 02:11 PM
Resize Range Problem ExcelMonkey[_16_] Excel Programming 3 January 23rd 04 11:15 PM
Need some help with Resize. Thanks John Wirt[_2_] Excel Programming 2 July 31st 03 08:37 AM


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