Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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 :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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 :)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default URGENT problem with Autofill in a macro

Thanks. that's great.



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
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
URGENT: Mac/PC Macro compatibility problem marika1981 Excel Programming 7 January 8th 05 08:58 AM
URGENT Mac/PC macro compatibility problem marika1981 Excel Discussion (Misc queries) 7 January 8th 05 12:43 AM
Problem with Autofill Macro Ben Allen Excel Programming 2 April 26th 04 07:42 PM
Macro help urgent urgent chandra Excel Programming 0 September 4th 03 03:50 PM


All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"