Insert Fomula while Cell is not empty

thrj

New Member
Joined
Apr 5, 2011
Messages
4
Hello Folks,

I have a spreadsheet which is refreshed every week. There is a field with the date, that is used to fill a weeknum formula. I need a macro that after the data is refreshed, check all the rows in column A until the last row filled, and I need it to get these dates from each field in column A and use the weeknum formula in column G. So the column G would use the date from column A to show the week number.

Could anyone give a hand?


Thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What method are you using to refresh the data? If it's a data connection you should be able to set the options to have formulas populate automatically.
 
Upvote 0
I am refreshing the data from an HTML page. Tried to use a loop to count column A until cell.value was <> from "" and fill the column G with weeknum related to the A column.. but did not manage to make it work. Does anyone have any idea of a macro to do that? :)
 
Upvote 0
It's be like:
Code:
Sub Marine()
   Range("A1",Range("A65536").End(xlUp)).Formula = "=myweeknumformula"
End Sub
... using your formula ( as per row 1 ) in there instead of the example text I used.
 
Upvote 0
Thanks! I manged to do what I was trying with the following formula:

Sub mapped()

Range("E2").AutoFill Destination:=Range("E2:E" & Cells(Rows.Count, "B").End(xlUp).Row)

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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