Problem in Range VBA excell...

  • Thread starter Thread starter JM
  • Start date Start date
J

JM

Hi.

i have teh folowing code in a excell doc, but it doesn´t work..
Can any one give me a hand? What´s wrong?

thanks!!
Jorge

Range("A1:C1").Select
Selection.AutoFill Destination:=Range("A1:C &
Worksheets("Geral").Cells(3, 31).Value"), Type:=xlFillDefault
Range("A1").Select

I want to copy a selection a ra range of cells that varyby the valeu
inserted in a cell (c31)
 
Hi JM,

I've not the faintest idea what you wanna do.

At least in
Destination:=Range("A1:C &
Worksheets("Geral").Cells(3, 31).Value") ...

there seems to be a quotation mark missing!
Destination:=Range("A1:C" &


--

Helmut Weber

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
change Cells(3, 31).Value".... to Cells(31,3).Value"....

"JM" skrev:
 
Hi JM,

I've not the faintest idea what you wanna do.

At least in


there seems to be a quotation mark missing!


--

Helmut Weber

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Hi helmut

Great eye! some times you look at things but you see them.... MY
CASE!!! LOL

Thanks a lot!
JM
 
Hi JM,

Try:

'=============>>
Public Sub Tester()
Dim SH As Worksheet
Dim i As Long

Set SH = ActiveSheet '<<==== CHANGE

i = Worksheets("Geral").Range("AE3").Value


Range("A1:C1").AutoFill Destination:=Range("A1:C" & i), _
Type:=xlFillDefault
End Sub
'<<=============
 
Hi JM,

The code was intended as:

'=============>>
Public Sub Tester()
Dim SH As Worksheet
Dim i As Long

Set SH = ActiveSheet '<<==== CHANGE

i = Worksheets("Geral").Range("AE3").Value


SH.Range("A1:C1").AutoFill Destination:=Range("A1:C" & i), _
Type:=xlFillDefault
End Sub
'<<=============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top