close

I have 500 question in a row,how can I insert column in between every
questions but there are some questions already inserted with column,is there
a method to save time so that each q. will have only 1 blank column in
between it?

Given that Excel only has 256 columns, how can you have 500 questions in a row?
So do you mean columns?

quot;cyquot; wrote:

gt; I have 500 question in a row,how can I insert column in between every
gt; questions but there are some questions already inserted with column,is there
gt; a method to save time so that each q. will have only 1 blank column in
gt; between it?

cy

There are only 256 columns in Excel so 500 is out of the question and inserting
even more columns is in the same category.

Perhaps re-think your question and re-post when more clear what you want to do.

Rows or Columns..........which is it?

Rows are 1,2,3,4,5 etc and Columns are A,B,C,D etc.Gord Dibben MS Excel MVPOn Sun, 30 Apr 2006 11:29:02 -0700, cy gt; wrote:

gt;I have 500 question in a row,how can I insert column in between every
gt;questions but there are some questions already inserted with column,is there
gt;a method to save time so that each q. will have only 1 blank column in
gt;between it?You must mean rows instead of columns.
Yes, VBA can do that, but Excel needs to know how to identify a line as
being the beginning of a new question. Pretend that you are explaining how
to do this to someone who doesn't know your data. What would you say to
him? HTH Otto
quot;cyquot; gt; wrote in message
...
gt;I have 500 question in a row,how can I insert column in between every
gt; questions but there are some questions already inserted with column,is
gt; there
gt; a method to save time so that each q. will have only 1 blank column in
gt; between it?
you don't know what i mean?
let say i have 5q. in a row that is A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
how can i insert a column next to each q. so that the seqence now is
A1(q.1),A2(blank),A3(q.2)........
but some blank columns have already inserted,so how to write that VBA?

quot;Otto Moehrbachquot; 來函:

gt; You must mean rows instead of columns.
gt; Yes, VBA can do that, but Excel needs to know how to identify a line as
gt; being the beginning of a new question. Pretend that you are explaining how
gt; to do this to someone who doesn't know your data. What would you say to
gt; him? HTH Otto
gt; quot;cyquot; gt; wrote in message
gt; ...
gt; gt;I have 500 question in a row,how can I insert column in between every
gt; gt; questions but there are some questions already inserted with column,is
gt; gt; there
gt; gt; a method to save time so that each q. will have only 1 blank column in
gt; gt; between it?
gt;
gt;
gt;


If you didn't call Row as Column you would be more easily understood

For what you require, see Dave Peterson's answer in
www.excelforum.com/showthread.php?t=537047

--
cy Wrote:
gt; you don't know what i mean?
gt; let say i have 5q. in a row that is
gt; A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
gt; how can i insert a column next to each q. so that the seqence now is
gt; A1(q.1),A2(blank),A3(q.2)........
gt; but some blank columns have already inserted,so how to write that VBA?
gt;
gt; quot;Otto Moehrbachquot; 來函:
gt;
gt; gt; You must mean rows instead of columns.
gt; gt; Yes, VBA can do that, but Excel needs to know how to identify a line
gt; as
gt; gt; being the beginning of a new question. Pretend that you are
gt; explaining how
gt; gt; to do this to someone who doesn't know your data. What would you say
gt; to
gt; gt; him? HTH Otto
gt; gt; quot;cyquot; gt; wrote in message
gt; gt; ...
gt; gt; gt;I have 500 question in a row,how can I insert column in between
gt; every
gt; gt; gt; questions but there are some questions already inserted with
gt; column,is
gt; gt; gt; there
gt; gt; gt; a method to save time so that each q. will have only 1 blank column
gt; in
gt; gt; gt; between it?
gt; gt;
gt; gt;
gt; gt;--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
View this thread: www.excelforum.com/showthread...hreadid=537608You are correct,Bryan i mix up column and row wrongly,and the answer is
partly correct only
..It is because like i said before,there are some blank rows already
inserted,after running the marco ,there will be 3 blank together,so is there
possible to rewrite the macro so that it will not adding a blank row before
and after the blank row that already exist?

quot;Bryan Hesseyquot; 來函:

gt;
gt; If you didn't call Row as Column you would be more easily understood
gt;
gt; For what you require, see Dave Peterson's answer in
gt; www.excelforum.com/showthread.php?t=537047
gt;
gt; --
gt; cy Wrote:
gt; gt; you don't know what i mean?
gt; gt; let say i have 5q. in a row that is
gt; gt; A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
gt; gt; how can i insert a column next to each q. so that the seqence now is
gt; gt; A1(q.1),A2(blank),A3(q.2)........
gt; gt; but some blank columns have already inserted,so how to write that VBA?
gt; gt;
gt; gt; quot;Otto Moehrbachquot; �*函:
gt; gt;
gt; gt; gt; You must mean rows instead of columns.
gt; gt; gt; Yes, VBA can do that, but Excel needs to know how to identify a line
gt; gt; as
gt; gt; gt; being the beginning of a new question. Pretend that you are
gt; gt; explaining how
gt; gt; gt; to do this to someone who doesn't know your data. What would you say
gt; gt; to
gt; gt; gt; him? HTH Otto
gt; gt; gt; quot;cyquot; gt; wrote in message
gt; gt; gt; ...
gt; gt; gt; gt;I have 500 question in a row,how can I insert column in between
gt; gt; every
gt; gt; gt; gt; questions but there are some questions already inserted with
gt; gt; column,is
gt; gt; gt; gt; there
gt; gt; gt; gt; a method to save time so that each q. will have only 1 blank column
gt; gt; in
gt; gt; gt; gt; between it?
gt; gt; gt;
gt; gt; gt;
gt; gt; gt;
gt;
gt;
gt; --
gt; Bryan Hessey
gt; ------------------------------------------------------------------------
gt; Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
gt; View this thread: www.excelforum.com/showthread...hreadid=537608
gt;
gt;


If you have already started to insert blanks, then adjust the number
shown as Startrow= from 1 to the first row you need. (in Dave's code)

FirstRow = 1 'no headers
to
FirstRow = 25 'no headers - the number being your first desired row

To insert only 1 blank, amend

.Rows(iRow).Resize(2).Insert
to
.Rows(iRow).Resize(1).Insert

This should work.

---

cy Wrote:
gt; You are correct,Bryan i mix up column and row wrongly,and the answer is
gt; partly correct only
gt; ..It is because like i said before,there are some blank rows already
gt; inserted,after running the marco ,there will be 3 blank together,so is
gt; there
gt; possible to rewrite the macro so that it will not adding a blank row
gt; before
gt; and after the blank row that already exist?
gt;
gt; quot;Bryan Hesseyquot; 來函:
gt;
gt; gt;
gt; gt; If you didn't call Row as Column you would be more easily understood
gt; gt;
gt; gt; For what you require, see Dave Peterson's answer in
gt; gt; www.excelforum.com/showthread.php?t=537047
gt; gt;
gt; gt; --
gt; gt; cy Wrote:
gt; gt; gt; you don't know what i mean?
gt; gt; gt; let say i have 5q. in a row that is
gt; gt; gt; A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
gt; gt; gt; how can i insert a column next to each q. so that the seqence now
gt; is
gt; gt; gt; A1(q.1),A2(blank),A3(q.2)........
gt; gt; gt; but some blank columns have already inserted,so how to write that
gt; VBA?
gt; gt; gt;
gt; gt; gt; quot;Otto Moehrbachquot; �*函:
gt; gt; gt;
gt; gt; gt; gt; You must mean rows instead of columns.
gt; gt; gt; gt; Yes, VBA can do that, but Excel needs to know how to identify a
gt; line
gt; gt; gt; as
gt; gt; gt; gt; being the beginning of a new question. Pretend that you are
gt; gt; gt; explaining how
gt; gt; gt; gt; to do this to someone who doesn't know your data. What would you
gt; say
gt; gt; gt; to
gt; gt; gt; gt; him? HTH Otto
gt; gt; gt; gt; quot;cyquot; gt; wrote in message
gt; gt; gt; gt; ...
gt; gt; gt; gt; gt;I have 500 question in a row,how can I insert column in
gt; between
gt; gt; gt; every
gt; gt; gt; gt; gt; questions but there are some questions already inserted with
gt; gt; gt; column,is
gt; gt; gt; gt; gt; there
gt; gt; gt; gt; gt; a method to save time so that each q. will have only 1 blank
gt; column
gt; gt; gt; in
gt; gt; gt; gt; gt; between it?
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt;
gt; gt;
gt; gt; --
gt; gt; Bryan Hessey
gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; Bryan Hessey's Profile:
gt; www.excelforum.com/member.php...oamp;userid=21059
gt; gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=537608
gt; gt;
gt; gt;--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
View this thread: www.excelforum.com/showthread...hreadid=537608oh my..............my blanks is distributed randomly,so is there any method
to chg the code to avoid insert blank when matching blanks

quot;Bryan Hesseyquot; 來函:

gt;
gt; If you have already started to insert blanks, then adjust the number
gt; shown as Startrow= from 1 to the first row you need. (in Dave's code)
gt;
gt; FirstRow = 1 'no headers
gt; to
gt; FirstRow = 25 'no headers - the number being your first desired row
gt;
gt; To insert only 1 blank, amend
gt;
gt; .Rows(iRow).Resize(2).Insert
gt; to
gt; .Rows(iRow).Resize(1).Insert
gt;
gt; This should work.
gt;
gt; ---
gt;
gt; cy Wrote:
gt; gt; You are correct,Bryan i mix up column and row wrongly,and the answer is
gt; gt; partly correct only
gt; gt; ..It is because like i said before,there are some blank rows already
gt; gt; inserted,after running the marco ,there will be 3 blank together,so is
gt; gt; there
gt; gt; possible to rewrite the macro so that it will not adding a blank row
gt; gt; before
gt; gt; and after the blank row that already exist?
gt; gt;
gt; gt; quot;Bryan Hesseyquot; �*函:
gt; gt;
gt; gt; gt;
gt; gt; gt; If you didn't call Row as Column you would be more easily understood
gt; gt; gt;
gt; gt; gt; For what you require, see Dave Peterson's answer in
gt; gt; gt; www.excelforum.com/showthread.php?t=537047
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; cy Wrote:
gt; gt; gt; gt; you don't know what i mean?
gt; gt; gt; gt; let say i have 5q. in a row that is
gt; gt; gt; gt; A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
gt; gt; gt; gt; how can i insert a column next to each q. so that the seqence now
gt; gt; is
gt; gt; gt; gt; A1(q.1),A2(blank),A3(q.2)........
gt; gt; gt; gt; but some blank columns have already inserted,so how to write that
gt; gt; VBA?
gt; gt; gt; gt;
gt; gt; gt; gt; quot;Otto Moehrbachquot; ä¾â€*函:
gt; gt; gt; gt;
gt; gt; gt; gt; gt; You must mean rows instead of columns.
gt; gt; gt; gt; gt; Yes, VBA can do that, but Excel needs to know how to identify a
gt; gt; line
gt; gt; gt; gt; as
gt; gt; gt; gt; gt; being the beginning of a new question. Pretend that you are
gt; gt; gt; gt; explaining how
gt; gt; gt; gt; gt; to do this to someone who doesn't know your data. What would you
gt; gt; say
gt; gt; gt; gt; to
gt; gt; gt; gt; gt; him? HTH Otto
gt; gt; gt; gt; gt; quot;cyquot; gt; wrote in message
gt; gt; gt; gt; gt; ...
gt; gt; gt; gt; gt; gt;I have 500 question in a row,how can I insert column in
gt; gt; between
gt; gt; gt; gt; every
gt; gt; gt; gt; gt; gt; questions but there are some questions already inserted with
gt; gt; gt; gt; column,is
gt; gt; gt; gt; gt; gt; there
gt; gt; gt; gt; gt; gt; a method to save time so that each q. will have only 1 blank
gt; gt; column
gt; gt; gt; gt; in
gt; gt; gt; gt; gt; gt; between it?
gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt;
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; Bryan Hessey
gt; gt; gt;
gt; gt; ------------------------------------------------------------------------
gt; gt; gt; Bryan Hessey's Profile:
gt; gt; www.excelforum.com/member.php...oamp;userid=21059
gt; gt; gt; View this thread:
gt; gt; www.excelforum.com/showthread...hreadid=537608
gt; gt; gt;
gt; gt; gt;
gt;
gt;
gt; --
gt; Bryan Hessey
gt; ------------------------------------------------------------------------
gt; Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
gt; View this thread: www.excelforum.com/showthread...hreadid=537608
gt;
gt;


try amending to:

For iRow = LastRow To FirstRow 1 Step -1

If .Cells(iRow - 1, 1).Value = quot;quot; Then
iRow = iRow - 1
Else
.Rows(iRow).Resize(1).Insert
End If
Next iRow--
cy Wrote:
gt; oh my..............my blanks is distributed randomly,so is there any
gt; method
gt; to chg the code to avoid insert blank when matching blanks
gt;
gt; quot;Bryan Hesseyquot; 來函:
gt;
gt; gt;
gt; gt; If you have already started to insert blanks, then adjust the number
gt; gt; shown as Startrow= from 1 to the first row you need. (in Dave's
gt; code)
gt; gt;
gt; gt; FirstRow = 1 'no headers
gt; gt; to
gt; gt; FirstRow = 25 'no headers - the number being your first desired row
gt; gt;
gt; gt; To insert only 1 blank, amend
gt; gt;
gt; gt; .Rows(iRow).Resize(2).Insert
gt; gt; to
gt; gt; .Rows(iRow).Resize(1).Insert
gt; gt;
gt; gt; This should work.
gt; gt;
gt; gt; ---
gt; gt;
gt; gt; cy Wrote:
gt; gt; gt; You are correct,Bryan i mix up column and row wrongly,and the
gt; answer is
gt; gt; gt; partly correct only
gt; gt; gt; ..It is because like i said before,there are some blank rows
gt; already
gt; gt; gt; inserted,after running the marco ,there will be 3 blank together,so
gt; is
gt; gt; gt; there
gt; gt; gt; possible to rewrite the macro so that it will not adding a blank
gt; row
gt; gt; gt; before
gt; gt; gt; and after the blank row that already exist?
gt; gt; gt;
gt; gt; gt; quot;Bryan Hesseyquot; �*函:
gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; If you didn't call Row as Column you would be more easily
gt; understood
gt; gt; gt; gt;
gt; gt; gt; gt; For what you require, see Dave Peterson's answer in
gt; gt; gt; gt; www.excelforum.com/showthread.php?t=537047
gt; gt; gt; gt;
gt; gt; gt; gt; --
gt; gt; gt; gt; cy Wrote:
gt; gt; gt; gt; gt; you don't know what i mean?
gt; gt; gt; gt; gt; let say i have 5q. in a row that is
gt; gt; gt; gt; gt; A1(q.1),A2(q.2),A3(q.3),A4(q.4),A5(q.5)
gt; gt; gt; gt; gt; how can i insert a column next to each q. so that the seqence
gt; now
gt; gt; gt; is
gt; gt; gt; gt; gt; A1(q.1),A2(blank),A3(q.2)........
gt; gt; gt; gt; gt; but some blank columns have already inserted,so how to write
gt; that
gt; gt; gt; VBA?
gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt; quot;Otto Moehrbachquot; ä¾â€*函:
gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt; gt; You must mean rows instead of columns.
gt; gt; gt; gt; gt; gt; Yes, VBA can do that, but Excel needs to know how to identify
gt; a
gt; gt; gt; line
gt; gt; gt; gt; gt; as
gt; gt; gt; gt; gt; gt; being the beginning of a new question. Pretend that you are
gt; gt; gt; gt; gt; explaining how
gt; gt; gt; gt; gt; gt; to do this to someone who doesn't know your data. What would
gt; you
gt; gt; gt; say
gt; gt; gt; gt; gt; to
gt; gt; gt; gt; gt; gt; him? HTH Otto
gt; gt; gt; gt; gt; gt; quot;cyquot; gt; wrote in message
gt; gt; gt; gt; gt; gt; ...
gt; gt; gt; gt; gt; gt; gt;I have 500 question in a row,how can I insert column in
gt; gt; gt; between
gt; gt; gt; gt; gt; every
gt; gt; gt; gt; gt; gt; gt; questions but there are some questions already inserted
gt; with
gt; gt; gt; gt; gt; column,is
gt; gt; gt; gt; gt; gt; gt; there
gt; gt; gt; gt; gt; gt; gt; a method to save time so that each q. will have only 1
gt; blank
gt; gt; gt; column
gt; gt; gt; gt; gt; in
gt; gt; gt; gt; gt; gt; gt; between it?
gt; gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt; gt;
gt; gt; gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; --
gt; gt; gt; gt; Bryan Hessey
gt; gt; gt; gt;
gt; gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; gt; gt; Bryan Hessey's Profile:
gt; gt; gt; www.excelforum.com/member.php...oamp;userid=21059
gt; gt; gt; gt; View this thread:
gt; gt; gt; www.excelforum.com/showthread...hreadid=537608
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt;
gt; gt;
gt; gt; --
gt; gt; Bryan Hessey
gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; Bryan Hessey's Profile:
gt; www.excelforum.com/member.php...oamp;userid=21059
gt; gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=537608
gt; gt;
gt; gt;--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: www.excelforum.com/member.php...oamp;userid=21059
View this thread: www.excelforum.com/showthread...hreadid=537608

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()