Object required?!?!

wsk92

New Member
Joined
Jul 6, 2015
Messages
21
Excel keeps saying there is an error with

startd = wb1.Sheets("Master List").Range(i, 10)

anyway i change it (taking away set, changing the dim of startd, doesnt seem to work)

Please help. (i am aware that there is probably a few other issues with this that i havent come across.....macros are hard!)

Sub COLLECT_INFO()

Dim i As Integer


Dim Weld As Variant, Elect As Variant, Paint As Variant, Assem As Variant
Dim wb1 As Workbook


Set wb1 = Workbooks.Open("EV ARC Master List (version 1).xlsx")


Dim SD As String
Dim FD As String


SD = "Project Start"
FD = "Project Finish"


i = 4


Dim startd As Integer
startd = wb1.Sheets("Master List").Range(i, 10)
Dim ARC_NUM As Integer
ARC_NUM = wb1.Sheets("Master List").Range(i, 2)


Weld = DateAdd(w, Sheets("Projects").Range(19, 4), start_d)
Elect = DateAdd(w, Sheets("projects").Range(20, 4), start_d)
Paint = DateAdd(w, Sheets("projects").Range(21, 4), Weld)
Assem = DateAdd(w, Sheets("projects").Range(22, 4), Paint)

thanks for the help.

Wsk92
 
looking at my locals window, CALDates has been found, but maybe its unaware that they are dates.

I am basically looking to make a macro that will take a start date from my "EV ARC Master List", and insert it into my project calendar, which has Project numbers along the top and dates of a month down the side. so the macro has to find the correct project number, and then find the correct date, go to that intersection and insert "Project Start" or something along those lines.

It would actually be a loop from there (hence the interger at the top) and would do the same for all projects.

Once i sort that out i want to add all the project tasks (hence the weld, electrics etc) into the calendar.

Sorry for my ignorance. i literally learnt about macros 2 weeks ago.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Michael,

Sorry i thought i had messaged back earlier.

I've actually tried that fndrow and it doesnt help unfortunately!!! :'(

The basic plan is to create a project calendar that takes the start date from my Masterlist excel, grabs various information from the project excel i created and then puts all the desired information into my calendar.

So the above stuff is the start of my loop macro. its finds the start date, matches it with the calendar, then finds the project number, then finds the right project number on the calendar and puts all the information into the calendar. so trying to find two variables and get the intersection of that.

Thanks again for the help.
 
Upvote 0
Bit hard to evaluate code for 2 workbooks, but if the line I mentioned is returning nothing, you will need to Debug either startd or CalDates.
Try changing the startd value to the current workbook and see if that appears in the offending line correctly
 
Upvote 0
sorted intersection, had to change the startd into a single, and change the format of the dates in the calendar to general, but il work out how to change them back to a date later.
 
Upvote 0
Once the dates are in place you can place another Dim statement in as Date further down in the code.
You can also reformat the cell the dates are in via the code as well.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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