Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a Type Error


I am trying to use the following Macro to copydown the Formula = C1 & E1
But I am getting a type error.

Public Sub CopyDown1()


Range("A1").Select
lastRow = Range("A65536").End(xlUp).Row
For i = 1 To lastRow
If Range("A" & i).Value = "" Then
Range("A" & i - 1 & ":A" & i - 1).Copy Destination:=Range("A" &
i)
End If
Next i

End Sub

What am I doing wrong?

The error is: Range("A" & i).Value = Error 2015


--
Pedros
------------------------------------------------------------------------
Pedros's Profile: http://www.excelforum.com/member.php...o&userid=28202
View this thread: http://www.excelforum.com/showthread...hreadid=569240

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a Type Error


you could try pasting this in to a standard module, you would need a
button on your toolbar to run the macro or a keyboard shortcut, you can
enter your range in the first input box and then your formula or
anything you want in the cells in the second.

Have fun!

Regards,
Simon

Sub cpystuff()
Dim rng As Range
Dim mycell
Dim t
t = InputBox("Enter your range in this format A1:A20", "Range entry",
"You must not use the inverted commas before and after the range")
s = InputBox("enter your formula here!")
Set rng = Range(t)
With Sheets(ActiveSheet.Name)
For Each mycell In rng
mycell.Value = s
Next mycell
End With
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=569240

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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
xpath error? Runtime Error 13 type mismatch SteveM Excel Discussion (Misc queries) 1 December 4th 07 09:16 AM
Conditional Formatting - Run Time Error '13' Type Mismatch Error ksp Excel Programming 0 July 11th 06 07:06 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM


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