Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using the AUTOFILL Function

I am trying to define a range for autofill with 2 textboxes on a userform.

This code is in the from module

Private Sub CommandButton1_Click()
ActiveCell = "C8"
ActiveCell.FormulaR1C1 = Me.TextBox2.Value
ActiveCell.Offset(1, 0).Activate
ActiveCell.FormulaR1C1 = Me.TextBox2 + 1
Range("C8:C9").Select
Selection.AutoFill Destination:=Range(Cells("8,C"),
Cells("me.TextBox2.Value = TextBox3.Value,C")), _
Type:=xlFillDefault

End Sub

This returns a type mismatch

Could anyone suggest why.

Thanks in in advance for any help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Using the AUTOFILL Function

I made some changes to the code and it runs. Not sure if it does exactly
what is is suppose to do, but I fixed the run time errors. The .cells()
wants numberical values not a string "8,c". Should be 8,3

Private Sub CommandButton1_Click()

ActiveCell = "C8"
ActiveCell.FormulaR1C1 = Me.TextBox2.Value
ActiveCell.Offset(1, 0).Activate
ActiveCell = Me.TextBox2 + 1
Range("C8:C9").Select
Selection.AutoFill Destination:=Range(Cells(8, 3), _
Cells(TextBox3.Value, 3)), _
Type:=xlFillDefault
Me.TextBox2.Value = TextBox3
End Sub




"Mark Dullingham" wrote:

I am trying to define a range for autofill with 2 textboxes on a userform.

This code is in the from module

Private Sub CommandButton1_Click()
ActiveCell = "C8"
ActiveCell.FormulaR1C1 = Me.TextBox2.Value
ActiveCell.Offset(1, 0).Activate
ActiveCell.FormulaR1C1 = Me.TextBox2 + 1
Range("C8:C9").Select
Selection.AutoFill Destination:=Range(Cells("8,C"),
Cells("me.TextBox2.Value = TextBox3.Value,C")), _
Type:=xlFillDefault

End Sub

This returns a type mismatch

Could anyone suggest why.

Thanks in in advance for any help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using the AUTOFILL Function

Thanks, that works a treat

Mark

"Joel" wrote:

I made some changes to the code and it runs. Not sure if it does exactly
what is is suppose to do, but I fixed the run time errors. The .cells()
wants numberical values not a string "8,c". Should be 8,3

Private Sub CommandButton1_Click()

ActiveCell = "C8"
ActiveCell.FormulaR1C1 = Me.TextBox2.Value
ActiveCell.Offset(1, 0).Activate
ActiveCell = Me.TextBox2 + 1
Range("C8:C9").Select
Selection.AutoFill Destination:=Range(Cells(8, 3), _
Cells(TextBox3.Value, 3)), _
Type:=xlFillDefault
Me.TextBox2.Value = TextBox3
End Sub




"Mark Dullingham" wrote:

I am trying to define a range for autofill with 2 textboxes on a userform.

This code is in the from module

Private Sub CommandButton1_Click()
ActiveCell = "C8"
ActiveCell.FormulaR1C1 = Me.TextBox2.Value
ActiveCell.Offset(1, 0).Activate
ActiveCell.FormulaR1C1 = Me.TextBox2 + 1
Range("C8:C9").Select
Selection.AutoFill Destination:=Range(Cells("8,C"),
Cells("me.TextBox2.Value = TextBox3.Value,C")), _
Type:=xlFillDefault

End Sub

This returns a type mismatch

Could anyone suggest why.

Thanks in in advance for any help

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
Excel Autofill Function [email protected] Excel Discussion (Misc queries) 1 August 4th 08 11:11 PM
No autofill VLookup function owl37 Excel Worksheet Functions 5 October 12th 06 09:41 PM
Using the autofill function but increment by certain number in function rishid Excel Worksheet Functions 1 July 14th 05 07:40 PM
Autofill Function PGalla06[_9_] Excel Programming 1 June 23rd 05 08:23 PM
INDIRECT Function and Autofill Neil Grantham Excel Worksheet Functions 1 April 21st 05 12:22 AM


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