Vba 第一行错误-Can';t在中断模式下执行代码

Vba 第一行错误-Can';t在中断模式下执行代码,vba,excel,Vba,Excel,我目前正在尝试使用Amazon平面文件简化我的生活,这样我就可以输入更多的数据,是的,代码非常简陋,但我现在只能做任何事情 我希望此程序从字符串/Int粘贴到列中 Sub Lines() Dim Brand, ClothingType, MaterialComposition, Department, StyleKeyword, TheCurrency, ProductDescription, Size, Size1, Size2, Size3, Size4, InnerOuterMat As

我目前正在尝试使用Amazon平面文件简化我的生活,这样我就可以输入更多的数据,是的,代码非常简陋,但我现在只能做任何事情

我希望此程序从字符串/Int粘贴到列中

Sub Lines()

Dim Brand, ClothingType, MaterialComposition, Department, StyleKeyword, TheCurrency, ProductDescription, Size, Size1, Size2, Size3, Size4, InnerOuterMat As String
Dim ItemPrice, ItemPrice2 As Double
Dim ProductSpecification, Season, CareInstructions, MaterialFabric1, Bullet1, Bullet2, Bullet3, Bullet4, Bullet5 As String
Dim ExternalTesting, Parent, Child, ParentSku, Relationship, TypeVariationTheme As String
Dim OtherImage, SaleDate1, SaleDate2 As String
Dim BrowseNode, Quantity, NumberOfItemsSalePrice, TimeToShip As Integer

    Brand = "Your Web Purchase"
    BrowseNode = "1731028031"
    ClothingType = "Shirt"
    MaterialComposition = "100%  Cotton"
    Department1 = "Apparel"
    TheCurrency = "GBP"
    StyleKeyword = "Apparel"
    ProductDescription = "Here at YWP we design a huge range of t-shirts. All of our t-shirts are created with love and the occasional cuddle to give you a unique sense of style and wit. Maybe you're a huge fan of TV, Video Games and Movies... we will have a t-shirt that's perfect"
    Size = "Small"
    Size1 = "Medium"
    Size2 = "Large"
    Size3 = "X-Large"
    Size4 = "XX-Large"
    InnerOuterMat = "Cotton"
    ItemPrice = "14.95"
    Quantity = "5000"
    ProductSpecification = "100% Cotton T-Shirt"
    Season = "Spring/Summer 14"
    CareInstructions = "Machine Washable at 40 degrees (wash inside out)"
    NumberOfItemsSalePrice = "1"
    MaterialFabric1 = "Cotton"
    Bullet1 = "Inspired By"
    Bullet2 = "Custom High Quality Exclusive Design Professionally Printedhart image)"
    Bullet3 = "100% Cotton - Soft Feel Ringspun Preshrunk Men's Tshirt (please check our size chart image)"
    Bullet4 = "Machine Washable at 40 degrees (wash inside out)"
    Bullet5 = "Check Out Our Wide Selection Of T-Shirts!"
    Child = "Child"
    Relationship = "Variation"
    OtherImage = "http://cdn.shopify.com/s/files/1/0095/3892/files/1AMAZON_MENS_Size_Chart.jpg?3145"
    ItemPrice2 = "9.69"
    SaleDate1 = "2013-07-17"
    SaleDate2 = "2050-07-18"

    ActiveCell.FormulaR1C1 = Brand
    ActiveCell.Offset(0, 0).Select

    Exit Sub

End Sub
显示错误的行

Sub Lines() 
编辑

只需更改子过程的名称:

来自

Sub Lines() ... End Sub

Sub AddLines() ... End Sub

它会起作用的。它抛出错误的原因是已经有一个子过程/函数定义了相同的名称——“行”。

从Q不清楚您当前的代码有什么问题。另外,显示错误的行是VB.NET或VBA?Sub line()。好的,检查我的更新答案!哦,我对VBA没有太多的经验,有人告诉我R1C1比使用值快得多。还有,我怎么能去削弱这些变量,因为有太多的变量看起来很不整洁。这似乎不起作用,我也会遇到同样的错误,单击“调试”将我导航到“subline()”的顶部。嗨,谢谢你的帮助,你能解释一下原因吗?你不是大声说出一个单词吗?哦,一个已经由VBA编写的子函数?如果你不介意的话,还有最后一件事。