Adding data from a userform then saving using a date filename?

djsouthcott

New Member
Joined
Jun 30, 2014
Messages
9
I am reasonably new to VB and I am trying to add data to a worksheet from a userform then I want to save the data on the worksheet using a certain cell as a filename, is this at all possible?


 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

djsouthcott

New Member
Joined
Jun 30, 2014
Messages
9
is it the same code? when I try to reuse the same code I get an error, I've changed the path and i would like to get rid of the meessage box asking me if i want to add a new record.
 
Upvote 0

djsouthcott

New Member
Joined
Jun 30, 2014
Messages
9
there's a problem with this line somehow?

activeworkbook.SaveAs Filename:=path & Range("A16").Text & Range("B14"), FileFormat:=51
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
83,077
Office Version
  1. 365
Platform
  1. Windows
What are the values of path , A16 & B14?
 
Upvote 0

djsouthcott

New Member
Joined
Jun 30, 2014
Messages
9
ahhhhh i'm guessing I have so set the values in the code? otherwise they are just numeric cells within the workbook. how would I set the values for them within the code?
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
83,077
Office Version
  1. 365
Platform
  1. Windows
You can use the cell values, it just depends on what those values are.
Do they have a special characters in them, does path end with a \ & does cell B14 end with .xlsx?
 
Upvote 0

Forum statistics

Threads
1,190,876
Messages
5,983,355
Members
439,840
Latest member
billy1989

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
Top