Macro Question

beckys

Board Regular
Joined
Apr 19, 2005
Messages
116
I have a report that can be run for various clients, and can have anywhere between 4 and 7 lines of data. I currently have a macro that does some re-formatting, and would also like to have the macro insert a date into a column, and carry that date down as many rows are included in the report.

The report headers are in rows 1:5, the column headers are in row 6, and the data starts in row 7. The data may continue to row 10, row 13, or anywhere in between.

Cell B4 includes the date range as text -
i.e. 02/01/2011 - 02/28/2011

I would like the end date (2/28/11) to be entered in column B, and in as many rows as the report contains data.

Does anyone have any suggestions on how to make this happen?

Thanks much for your assistance!
Becky
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
This might get you started:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>        i = Cells(Rows.Count, "A").End(xlUp).Row<br>        <br>        Range("B7:B" & i).Value = Right([B4], 11)<br>        <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0
Actually, on a related note, I am hoping that you can help with another piece of code.

In column D (Range ("D7:D" & i), I would like to enter a value that would be a pretty simple if statement in excel:

IF(B2="FUND C", "ELP C", RIGHT(B2,2))

Do you know how to incorporate this into a macro?

Thanks!!!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,711
Members
452,939
Latest member
WCrawford

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