![]() |
URGENT problem with Autofill in a macro
I wrote a macro which uses Autofill and End(xlDown) to fill in twenty or so
blank cells in a column before hitting text below. When I perform the macro on my computer it works fine; however, on my client's computer, executing the macro replaces the ENTIRE column of text, overwriting all data below rather than just filling in blank cells until it hits text/data. Specifically, the formula I'm using, (which should copy the contents of E12:G12 down through a series of blank cells until it hits text) is: Range("E12:G12").AutoFill Destination:=Range("E12", Range("G12").End(xlDown) (0)) Any ideas what might cause this and how to fix????? MANY, MANY, MANY THANKS, Marika :) |
URGENT problem with Autofill in a macro
What happens if you eliminate that stray (0) at the end?
To debug, I would try identifying the cell found with End(xlDown), i.e. Set Rng1 = Range("E12:G12") Set Rng2 = Range("G12").End(xlDown) Debug.Print Rng2.Address On Mon, 21 Feb 2005 18:23:01 -0800, "marika1981" wrote: I wrote a macro which uses Autofill and End(xlDown) to fill in twenty or so blank cells in a column before hitting text below. When I perform the macro on my computer it works fine; however, on my client's computer, executing the macro replaces the ENTIRE column of text, overwriting all data below rather than just filling in blank cells until it hits text/data. Specifically, the formula I'm using, (which should copy the contents of E12:G12 down through a series of blank cells until it hits text) is: Range("E12:G12").AutoFill Destination:=Range("E12", Range("G12").End(xlDown) (0)) Any ideas what might cause this and how to fix????? MANY, MANY, MANY THANKS, Marika :) |
URGENT problem with Autofill in a macro
This is a side question.This Debug.Print thing....where does it print?
I have tried before to use this and I can't find anything in any of my open books. A simple thing I know but it's usually the simplest that catch you out! Donna |
URGENT problem with Autofill in a macro
Hi Donna,
In the project explorer, make the debug toolbar visible and click the immediate window icon (the one with an exclamation mark). This is very handy to control exectution of your code, or to assign value to variable which are not yet initialised. To get info in the immediate window , use debug.print in your sub (eg debug.print "Age variable value = " & myVarAge) To ask value in debug mode, type directly in the immediate window : << ? myVarAgeenter. The ? is like debug.print in sub. You can also assign value by typing : <<myVarAge= 18 Regards Jean-Yves wrote in message ups.com... This is a side question.This Debug.Print thing....where does it print? I have tried before to use this and I can't find anything in any of my open books. A simple thing I know but it's usually the simplest that catch you out! Donna |
URGENT problem with Autofill in a macro
Thanks. that's great.
|
All times are GMT +1. The time now is 05:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com