Add New Column

amit186

New Member
Joined
Sep 21, 2010
Messages
2
Hi All,

I have a requirement where I have to format a given spreadsheet which has multiple columns(almost 20 ) and 400-500 rows to have 3 columns only of which 2 columns come from the base spreadsheet and the 3rd column is Date column for which I have to prompt user.

I have the macro for to delete the all the other columns and have the spreadsheet with 2 columns done but I am having difficulty to add the 3rd column.

Any ideas ?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi, welcome to the board.

Have a look at this link to create a pop-up calendar for the user to select a date from:
http://www.yogeshguptaonline.com/search/label/Excel%20Pop%20up%20Calendar

Once this populates a cell in your third column (let's assume it populates into C1), you can then fill in the rest of your third column as:
Code:
Dim i as Long
i = Range("A" & Rows.Count).End(xlUp).Row)
With Range("C2:C" & i)
 .Formula = "=$C$1"
 .Value = .Value
End With
 
Upvote 0
Thanks so much for the reply. I was finally able to resolve it as follows:

I prompt the user to enter the date in=>

cDate= InputBox("Enter the Date in (DD/MM/YY) for which you want to insert the data E.g. 09/12/10")

Then using the code as above

Range("C1").Value = "Date"
Range("C1").Font.FontStyle = "Bold"

i = Range("A" & Rows.Count).End(xlUp).Row
With Range("C2:C" & i)
.Value = cDate
End With

Thanks again !
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top