Macro help!

Meadowhall

New Member
Joined
Nov 11, 2005
Messages
2
Hi

I did a search and didn't find anything similar, so I'm sorry if it's a repost.


I'm a complete n00b when it comes to Excel, so I apologise in advance!
I'm working with a spreadsheet that uses a Macro to select data. The problem is that it is set to select everything from that button (about row 10) until row 850, and this current spreadsheet only has data until row 799. There's an extra 51 rows that it's selecting that have no data in (and is filled in with zeros).
I would just change it to select until row 799, but the data is constantly changing and next time might be until row 830 (and being set to 799 wouldn't include that data).


This is the Macro:

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 10/11/2005
'

'
Range("A11:J11").Select
Selection.AutoFill Destination:=Range("A11:J850"), Type:=xlFillDefault
Range("A11:J850").Select
End Sub


Is there any way of only selecting the data until where it ends? The last row I need to select is the Grand Total line; is there some way of tying it into the Grand Total formulas?

Thanks for any and all help! :)

M
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Range("A11:J11").Select
Selection.Copy

Range("a11:j" & Range("j65536").End(xlUp).Row).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
 
Upvote 0

Forum statistics

Threads
1,214,659
Messages
6,120,781
Members
448,992
Latest member
prabhuk279

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top