PDA

View Full Version : Inserting a row or a column



prshnthvn
04-24-2010, 03:54 PM
Hello Everybody,

I am comparing 2 sets of data's. The number of rows or columns will not be constant every-time when i run this comparison.

I want to know how to insert a row or a column when the data is missing/extra in either of the data. for e.g. if the 3rd column is missing in the 2nd data, i want to insert a new column in the 2nd data.

Thanks in advance,
Prashanth Vakkund

austenr
04-24-2010, 06:14 PM
A small sample workbook would help.

prshnthvn
04-25-2010, 01:03 AM
I hope this will give a clear idea on what I have explained in by query.

DATA-1
Sale Jan Feb Mar Apr May
S1 12 23 49 82 56
S2 34 86 33 37 42
S3 54 76 46 45 23
S4 38 56 59 81 67
S5 67 54 90 29 69
S6 23 45 16 78 28


DATA-2
Sale Jan Feb Mar May
S1 12 23 49 56
S2 34 86 33 42
S4 38 56 59 67
S5 67 54 90 69
S6 23 45 16 28

OUTPUT
DATA-1 DATA-2
Sale Jan Feb Mar Apr May Sale JanFeb Mar May
S1 12 23 49 82 56 S1 12 23 49 56
S2 34 86 33 37 42 S2 34 86 33 42
S3 54 76 46 45 23
S4 38 56 59 81 67 S4 38 56 59 67
S5 67 54 90 29 69 S5 67 54 90 69
S6 23 45 16 78 28 S6 23 45 16 28

mdmackillop
04-25-2010, 04:25 AM
You can post a workbook using Manage Attachments in the Go Advanced reply section. Your layout of data can affect the solution.

prshnthvn
04-25-2010, 10:46 PM
I have attached the sample data. Can anyone let me know how to insert a row or/and column as shown in the xls?

Thanks

mdmackillop
04-27-2010, 05:33 AM
Try this for inserting rows. The code requires a list of all row values to be referenced, which I have added to Sheet 2. This could be automated if required.
To insert columns, copy and ajdust the code to work horizontally, rather than vertically. If you get stuck, let us know.