macro

Freddie

New Member
Joined
Apr 4, 2002
Messages
2
Somebody created this macro for me to add information from one page and drop it onto another page each time as user add information which basically should create a small database. The macro was working fine but it doesnt seem to be working any more :( any help would be appericated, thanks

Sheet16_start = "B1" 'Start Cell for Second Sheet.
Sheet16.Activate

Range(Sheet16_start).Activate

Cell = "foo" 'creates a tmp value for loop
Range(Sheet16_start).Activate

'Keeps going through until blank cell is found
Do Until Cell = ""
Cell = ActiveCell.Text
If Cell <> "" Then
ActiveCell.Offset(0, 1).Select
End If
Loop

For i = 1 To 20 '20 being the number of cells to copy
Sheet26.Activate
Sheet26.Range("B" & i).Select 'Go to the cell dicated to the loop
txt = Sheet26.Range("B" & i).Text 'select the cell
Sheet16.Activate
ActiveCell.Value = txt
ActiveCell.Offset(1, 0).Select
Next

Sheet1.Activate
End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Freddie
In what way is the macro not working? Does it do anything? Does it display a runtime error message? What line does the code break on? What might you have changed that prevents the code from running,like changing sheet names etc, or using it on a different operating system eg from NT4 to Windows2000?
If you post this, someone will probably know the answer.
regards
Derek
 
Upvote 0
It says it has a compile error and it cant find the project or library even though I havent changed the sheet name. The sheet name is 5 but the sheet number is 16 if that makes sense. Anyways I was told to use the sheet number for the macro. The OS is Me and im using office XP if that helps thanks
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,027
Members
448,543
Latest member
MartinLarkin

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