Hi guys,
I am wondering if i can use something like this:
Because for now it does not do anything but compiles...![]()
Please Login or Register to view this content.
Cheers
Hi guys,
I am wondering if i can use something like this:
Because for now it does not do anything but compiles...![]()
Please Login or Register to view this content.
Cheers
The 1st and last Cells references were not qualified with Sheets(tab1)
Or you could use something like this...![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Allow me to elaborate just a bit. Using Cells with no qualification will default, but what it defaults to depends on where this code is located. In general, it is better to qualify it as AlphaFrog has demonstrated.
- If the code is in a Sheet module, then Cells refers to that sheet.
- If the code is in a Module module, then Cells refers to the active worksheet.
From your code, it is not absolutely certain where it is, or what you want Cells to refer to.
Also test if both of these comparisons evaluate to TRUE.
Sheets(tab1).Cells(i, 6) = Sheets("Machining").Range("j10") And Sheets(tab1).Cells(i, 12) = "As wound"
If they are comparing strings, the comparison is case sensitive e.g; "Hello" is not equal to "hello".
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks