I need relative macro for autocopy range ("I4:I110") from previously sheet to ("E4:E110") in next sheet!
I need that for my inventory list
I need relative macro for autocopy range ("I4:I110") from previously sheet to ("E4:E110") in next sheet!
I need that for my inventory list
Hi,
Does this help
VBA NoobPlease Login or Register to view this content.
Last edited by VBA Noob; 01-16-2007 at 07:08 PM.
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Sub macro()
Dim Sht1 As Worksheet
Set Sht1 = ActiveSheet
Sht1.Range("I4:I110").Copy ActiveSheet.Next.Range("E4:E110")' Change Next to Previous if that's what you meant
End Sub
Your macro is working but I forgot to say that those two columns need to be linked, in order to see the changes that will appear in Range("I4:I110")...
This is macro where I need to add this kind of formula, in order to be automated while starting this excel document.
Private Sub Workbook_Open()
ActiveSheet.Copy Before:=Sheets("NARUDŽBA")
UserForm1.Show
ActiveSheet.Name = Range("B2")
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim LastColumn As Integer
Dim LastRow As Long
Dim LastCell As Range
If WorksheetFunction.CountA(Sh.Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Sh.Cells.Find(What:="*", After:=Sh.Cells(1, 1), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
If LastRow <> 65536 Then LastRow = LastRow + 1
'Search for any entry, by searching backwards by Columns.
LastColumn = Sh.Cells.Find(What:="*", After:=Sh.Cells(1, 1), _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
If LastColumn <> 256 Then LastColumn = LastColumn + 1
Sh.ScrollArea = Range(Cells(1, 1), Cells(LastRow + 1, LastColumn + 1)).Address
Else
Sh.ScrollArea = ""
End If
End Sub
Sincerely yours,
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks