L
LG
Currently we have an excel doc that has the following macro built Sub
Carrier_InfoFill(raddress, xcol)
On Error Resume Next
Static CurrentSheet
Set CurrentSheet = ActiveSheet
'get the carrier from the selected cell...
ncarrier = UCase(CurrentSheet.Range(raddress))
If ncarrier = "" Then Exit Sub
'get the row number of the selected cell...
xrow = CurrentSheet.Range(raddress).Row
'find the sheet that the carrier is located in...
For sn = 2 To 5
nrow = 2
'find the carrier column...
ccol = 1
Do Until Left(Sheets(sn).Cells(1, ccol), 7) = "Carrier"
ccol = ccol + 1
Loop
Do Until Sheets(sn).Cells(nrow, ccol) = ""
'if the carrier is found,
If UCase(Sheets(sn).Cells(nrow, ccol)) = ncarrier Then
With Sheets(sn)
'copy the contents of the 10 columns of the found sheet into the
appeals sheet...
.Range(.Cells(nrow, ccol), .Cells(nrow, ccol + 9)).Copy _
Destination:=CurrentSheet.Cells(xrow, xcol)
End With
End If
'increment the row for the carrier search...
nrow = nrow + 1
Loop
Next sn
End Sub
What this does is when the processor enters a number it automatically fills
the Agency, address and phone numbers in the appropriate fields. I would
like to use this in access in a form? Is this possible? Currently it is
entered into excel and manually transfer them everyday. I know that excel
does a good job with macros for this sort of stuff but, I need the data in
one spot for government regulations and audits.
Any help would be appreciated
Carrier_InfoFill(raddress, xcol)
On Error Resume Next
Static CurrentSheet
Set CurrentSheet = ActiveSheet
'get the carrier from the selected cell...
ncarrier = UCase(CurrentSheet.Range(raddress))
If ncarrier = "" Then Exit Sub
'get the row number of the selected cell...
xrow = CurrentSheet.Range(raddress).Row
'find the sheet that the carrier is located in...
For sn = 2 To 5
nrow = 2
'find the carrier column...
ccol = 1
Do Until Left(Sheets(sn).Cells(1, ccol), 7) = "Carrier"
ccol = ccol + 1
Loop
Do Until Sheets(sn).Cells(nrow, ccol) = ""
'if the carrier is found,
If UCase(Sheets(sn).Cells(nrow, ccol)) = ncarrier Then
With Sheets(sn)
'copy the contents of the 10 columns of the found sheet into the
appeals sheet...
.Range(.Cells(nrow, ccol), .Cells(nrow, ccol + 9)).Copy _
Destination:=CurrentSheet.Cells(xrow, xcol)
End With
End If
'increment the row for the carrier search...
nrow = nrow + 1
Loop
Next sn
End Sub
What this does is when the processor enters a number it automatically fills
the Agency, address and phone numbers in the appropriate fields. I would
like to use this in access in a form? Is this possible? Currently it is
entered into excel and manually transfer them everyday. I know that excel
does a good job with macros for this sort of stuff but, I need the data in
one spot for government regulations and audits.
Any help would be appreciated