vba excel:如何用文本填充两行单元格 [英] vba excel: How to fill in two cells in a row with text

查看:254
本文介绍了vba excel:如何用文本填充两行单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用VBA在我的excel表中创建一个标题。似乎很简单,但是当我这样做

I need to make a header in my excel sheet using VBA. Seems pretty simple, but when I do this

Worksheets("New_Students").Range("A1").Value = "studentID"
Worksheets("New_Students").Range("B1").Value = "ISUID"

只有第一行工作,而不是第二行。我忘记了什么?

only the first line works and not the second one. What am I forgetting?

推荐答案

尝试这样:


  1. 在excel应用程序中,转到功能区上的开发人员选项卡,然后单击记录宏。

  2. 手动输入两个单元格中的值。

  3. 点击停止录制并查看它创建的宏。

这将显示您可以使用的VBA代码,您可以比较它你有什么要麻烦拍摄。

This would show you VBA code that will work and you can compare it to what you have in order to trouble shoot.

这被称为记录宏,可以非常有助于解决问题。事实上,我建议几乎每次在这里提出问题之前这样做。

This is called recording a macro and can be very helpful in solving problems. In fact I would suggest doing so almost every time before asking a question here.

这篇关于vba excel:如何用文本填充两行单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆