Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Autocopy instead of autofill

Hi all,

I use this code to autofill a range.

Private Sub CommandButton1_Click()
'Macro_om_datum_te_genereren
Dim rng As Range
Set rng = ActiveSheet.Range("J9")

rng.AutoFill Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))

End Sub

Things is, don't want VBA to fill but to copy the information. What small
modifcation needs to be done to get this code working?!

Regards

Sebastiaan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Autocopy instead of autofill

from
rng.AutoFill Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))

to

rng.copy destination:=Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))


"Basta1980" wrote:

Hi all,

I use this code to autofill a range.

Private Sub CommandButton1_Click()
'Macro_om_datum_te_genereren
Dim rng As Range
Set rng = ActiveSheet.Range("J9")

rng.AutoFill Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))

End Sub

Things is, don't want VBA to fill but to copy the information. What small
modifcation needs to be done to get this code working?!

Regards

Sebastiaan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Autocopy instead of autofill

..autofill has several parms that you can include.

I'd try:

rng.AutoFill _
destination:=Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1)), _
type:=xlFillCopy


Basta1980 wrote:

Hi all,

I use this code to autofill a range.

Private Sub CommandButton1_Click()
'Macro_om_datum_te_genereren
Dim rng As Range
Set rng = ActiveSheet.Range("J9")

rng.AutoFill Range(rng, rng.Offset(0, -1).End(xlDown).Offset(0, 1))

End Sub

Things is, don't want VBA to fill but to copy the information. What small
modifcation needs to be done to get this code working?!

Regards

Sebastiaan


--

Dave Peterson
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
How can I autocopy text from one textbox to another using VBA in E SunFUd01 Excel Discussion (Misc queries) 0 November 18th 09 06:24 PM
Autocopy formula in tables Stacey Excel Discussion (Misc queries) 1 December 20th 07 10:06 AM
Autocopy formula without VB johnsonlnl29 Excel Discussion (Misc queries) 1 December 15th 06 04:28 PM
Autocopy formula to cells ASU Excel Discussion (Misc queries) 1 September 8th 06 04:43 PM
Autocopy between 2 workbooks FrigidDigit Excel Programming 2 July 29th 05 06:30 AM


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