![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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
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 |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
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 |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
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
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|