Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
hi.
how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
How about the DataForm...menu?
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Under Data...I don't see form.
How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Maybe your data doesn't start in the location excel expects:
http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Hi,
ok, i see the table...except it's all empty. I'm just a beginner...please be patient. my column headings for my items is b5 thru f5. then all the detail will be b6 thru f6....down to bxxxxx to fxxxxxxx please tell me where to adjust. i had copied the macro into my spreadsheet. thanks "Dave Peterson" wrote: Maybe your data doesn't start in the location excel expects: http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Your table shouldn't be empty--it has to have headers.
Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .Range("A5:F" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub Carrie wrote: Hi, ok, i see the table...except it's all empty. I'm just a beginner...please be patient. my column headings for my items is b5 thru f5. then all the detail will be b6 thru f6....down to bxxxxx to fxxxxxxx please tell me where to adjust. i had copied the macro into my spreadsheet. thanks "Dave Peterson" wrote: Maybe your data doesn't start in the location excel expects: http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson -- Dave Peterson |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Hi Dave,
I tested this as I could see some use for myself. Hence my comments..... 1. Shouldn't at least one row of data be already entered within the table range for the data form to appear? When my data area (other than the headers) was blank, I too got the error 1004 message. 2. I think the range should be B5:F....... otherwise an empty unnecessary field will appear at the top of the Data form. Rob "Dave Peterson" wrote in message ... Your table shouldn't be empty--it has to have headers. Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .Range("A5:F" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub Carrie wrote: Hi, ok, i see the table...except it's all empty. I'm just a beginner...please be patient. my column headings for my items is b5 thru f5. then all the detail will be b6 thru f6....down to bxxxxx to fxxxxxxx please tell me where to adjust. i had copied the macro into my spreadsheet. thanks "Dave Peterson" wrote: Maybe your data doesn't start in the location excel expects: http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
Thanks for testing.
You're correct. It looks like excel wants at least one line of data. (I guessed wrong!) Maybe this would be better: Option Explicit Sub testme01() Dim LastRow As Long Application.DisplayAlerts = False With ActiveSheet LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row If LastRow = 5 Then LastRow = 6 End If .Range("A5:F" & LastRow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub RobN wrote: Hi Dave, I tested this as I could see some use for myself. Hence my comments..... 1. Shouldn't at least one row of data be already entered within the table range for the data form to appear? When my data area (other than the headers) was blank, I too got the error 1004 message. 2. I think the range should be B5:F....... otherwise an empty unnecessary field will appear at the top of the Data form. Rob "Dave Peterson" wrote in message ... Your table shouldn't be empty--it has to have headers. Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .Range("A5:F" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub Carrie wrote: Hi, ok, i see the table...except it's all empty. I'm just a beginner...please be patient. my column headings for my items is b5 thru f5. then all the detail will be b6 thru f6....down to bxxxxx to fxxxxxxx please tell me where to adjust. i had copied the macro into my spreadsheet. thanks "Dave Peterson" wrote: Maybe your data doesn't start in the location excel expects: http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
macros
ps. Yep. And that line should have been:
..Range("b5:F" & LastRow).Name = "'" & .Name & "'!database" (starting in column B) RobN wrote: Hi Dave, I tested this as I could see some use for myself. Hence my comments..... 1. Shouldn't at least one row of data be already entered within the table range for the data form to appear? When my data area (other than the headers) was blank, I too got the error 1004 message. 2. I think the range should be B5:F....... otherwise an empty unnecessary field will appear at the top of the Data form. Rob "Dave Peterson" wrote in message ... Your table shouldn't be empty--it has to have headers. Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"B").end(xlup).row .Range("A5:F" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub Carrie wrote: Hi, ok, i see the table...except it's all empty. I'm just a beginner...please be patient. my column headings for my items is b5 thru f5. then all the detail will be b6 thru f6....down to bxxxxx to fxxxxxxx please tell me where to adjust. i had copied the macro into my spreadsheet. thanks "Dave Peterson" wrote: Maybe your data doesn't start in the location excel expects: http://support.microsoft.com/default...;en-us;q110462 XL: ShowDataForm Method Fails If Data Can't Be Found You can use code like this if you know (or can determine) the range: Option Explicit Sub testme01() Dim LastRow as Long Application.DisplayAlerts = False With activesheet lastrow = .cells(.rows.count,"A").end(xlup).row .Range("A4:x" & lastrow).Name = "'" & .Name & "'!database" .ShowDataForm End With Application.DisplayAlerts = True End Sub I started in A4 until the last used row in column A, then extended it to columns A:X of those rows. Carrie wrote: Under Data...I don't see form. How would I correct the macro?? activesheet.showdataform has a run time error of 1004...don't understand why it does this. i'm in 2007 excel. "Bob Phillips" wrote: How about the DataForm...menu? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie" wrote in message ... hi. how do i make a macro to open up the form...for an excel spreadsheet with data being entered? I tried making a new macro..then hitting the form button... and the macro said activeworksheet.open....I forgot. anyways it came back with an error on it. how do i assign the macro to a form button? thanks!! Merry Christmas -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macros warning always shows up, even if all macros removed | Excel Discussion (Misc queries) | |||
Macros - copying macros from one computer to another | Excel Discussion (Misc queries) | |||
"openinf file..."ENABLE MACROS...DISABLE MACROS" | Excel Discussion (Misc queries) | |||
macros | Excel Worksheet Functions | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions |