Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 :) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 :) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. that's great.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Urgent Help Required on Excel Macro Problem | Excel Discussion (Misc queries) | |||
URGENT: Mac/PC Macro compatibility problem | Excel Programming | |||
URGENT Mac/PC macro compatibility problem | Excel Discussion (Misc queries) | |||
Problem with Autofill Macro | Excel Programming | |||
Macro help urgent urgent | Excel Programming |